title: Python regex replacement with str.replace. Pattern (wordhypenword) Replacement (wordspacehypenspaceword)
body: <p>I have the following regex pattern word-word, so</p>
  <pre><code>r'\w+\-\w+ 
  </code></pre>
  <p>I would like to replace it with</p>
  <pre><code>r'\w+\s\-\s\w+
  </code></pre>
  <p><strong>Example:</strong>
  I would like to change</p>
  <pre><code>hello-friends to hello - friends 
  </code></pre>
  <p><strong>I have tried the following with no success</strong></p>
  <pre><code>df['mytextcolumn'].str.replace(r'(\\w+)(\\-)(\\w+)',r'(\\w+)(\\s)(\\-)(\\s)(\\w+)')
  
  </code></pre>
  <p><strong>also tried with re.sub</strong></p>
  <pre><code>re.sub(r'\\w+\\-\\w+',r'\\w+\\s\\-\\s\\w+','hello-friends') 
  
  but I still get back hello-friends, not hello - friends
  </code></pre>
  <p>I also checked my regex with an online regex matcher for python, and it picks up the patterns correctly, so I am confused why I am unable to replace it within my script.</p>