title: How to find values in string, manipulate and replace them
body: <p>How to find values in string, add specific value to each of them and replace output with fixed string.</p>
  
  <pre><code>import re
  def _replace(content):
      #x = float(content.group(4))+20
      #y = float(content.group(6))+20
      return content.group(6)
  print re.sub('&lt;g(\s)transform="matrix\((.*)(\s)(.*)(\s)(.*)\)\"', _replace, '&lt;g transform="matrix(0.412445 -0.0982513 0.0982513 0.412445 -5.77618 67.0025)"&gt;')
  </code></pre>