title: Regex add character to matched string
body: <p>I have a long string which is a paragraph, however there is no white space after periods. For example:</p>
  
  <pre><code>para = "I saw this film about 20 years ago and remember it as being particularly nasty. I believe it is based on a true incident: a young man breaks into a nurses\' home and rapes, tortures and kills various women.It is in black and white but saves the colour for one shocking shot.At the end the film seems to be trying to make some political statement but it just comes across as confused and obscene.Avoid."
  </code></pre>
  
  <p>I am trying to use re.sub to solve this problem, but the output is not what I expected.</p>
  
  <p>This is what I did:</p>
  
  <pre><code>re.sub("(?&lt;=\.).", " \1", para)
  </code></pre>
  
  <p>I am matching the first char of each sentence, and I want to put a white space before it. My match pattern is <code>(?&lt;=\.).</code>, which (supposedly) checks for any character that appears after a period. I learned from other stackoverflow questions that \1 matches the last matched pattern, so I wrote my replace pattern as <code>\1</code>, a space followed by the previously matched string. </p>
  
  <p>Here is the output:</p>
  
  <pre><code>"I saw this film about 20 years ago and remember it as being particularly nasty. \x01I believe it is based on a true incident: a young man breaks into a nurses\' home and rapes, tortures and kills various women. \x01t is in black and white but saves the colour for one shocking shot. \x01t the end the film seems to be trying to make some political statement but it just comes across as confused and obscene. \x01void. \x01
  </code></pre>
  
  <p>Instead of matching any character preceded by a period and adding a space before it, <code>re.sub</code> replaced the matched character with <code>\x01</code>. Why? How do I add a character before a matched string?</p>