title: Remove specific brackets from string
body: <p>I have a list of say: </p>
  
  <pre><code>(UH[0], UH[1], UH[2], UH[3].... )
  </code></pre>
  
  <p>I want to use re.sub to remove everything from each element of the list except the number so that it is </p>
  
  <pre><code>(0 , 1 , 2 , 3 .....)
  </code></pre>
  
  <p>I tried with: </p>
  
  <pre><code>re.sub ('[UH^[]]' ,'', each_element)
  </code></pre>
  
  <p>but it doesn't work.</p>