title: How to modify the content of a string using Regular Expression (Just like String.Replace)
body: <p>I want to replace the content of a string using regex in python.</p>
  
  <p>I have tried the following code:</p>
  
  <pre><code>regex=r"(?:ab*)\w+"
  text ="absd 2013 abpq ab 123absd"
  pattern=re.compile(regex)
  print pattern.sub("dummy",text)
  </code></pre>
  
  <p>I got the output like this:</p>
  
  <pre><code>dummy 2013 dummy dummy 123dummy
  </code></pre>
  
  <p>But my actual text is still same.</p>
  
  <p>Can I modify the text itself with a regex?</p>