title: how to make the width and height x2 using python Regular
body: <p>i have to do many work to change like this:</p>
  
  <pre><code>&lt;img src = "/" height="111" width="10" /&gt;
  </code></pre>
  
  <p>to </p>
  
  <pre><code>&lt;img src = "/" height="222" width="20" /&gt;
  </code></pre>
  
  <p>so i want to use python Regular
  this is my code :</p>
  
  <pre><code>import re
  
  s = '&lt;img src = "werwerwe" height="111" width="10" /&gt;'
  
  def a(x):
      print x.group(2)
      print x.group(4)
  
  ss = re.sub(r'''&lt;img.*(width\s*="?(\d+)"?)*\s*(height\s*="?(\d+)"?)*''',a, s)
  
  print ss
  </code></pre>
  
  <p>so what can i do ,</p>
  
  <p>thanks</p>
  
  <p><strong>updated:</strong></p>
  
  <p>it is ok now :</p>
  
  <pre><code>import re
  
  s = '&lt;img src = "/" height="111" width="10" /&gt;'
  
  
  def a(x):
      b = x.group(0)
      b = b.replace(x.group(1),str(int(x.group(1))*2))
      b = b.replace(x.group(2),str(int(x.group(2))*2))
      return b
  
  ss = re.sub(r'''&lt;img.*?height=\"(\d+)\".*?width=\"(\d+)\"[^&gt;]*&gt;''',a, s)
  
  print ss
  </code></pre>