title: How to input a regex in string.replace?
body: <p>I need some help on declaring a regex. My inputs are like the following:</p>
  <pre class="lang-none prettyprint-override"><code>this is a paragraph with&lt;[1&gt; in between&lt;/[1&gt; and then there are cases ... where the&lt;[99&gt; number ranges from 1-100&lt;/[99&gt;. 
  and there are many other lines in the txt files
  with&lt;[3&gt; such tags &lt;/[3&gt;
  </code></pre>
  <p>The required output is:</p>
  <pre class="lang-none prettyprint-override"><code>this is a paragraph with in between and then there are cases ... where the number ranges from 1-100. 
  and there are many other lines in the txt files
  with such tags
  </code></pre>
  <p>I've tried this:</p>
  <pre><code>#!/usr/bin/python
  import os, sys, re, glob
  for infile in glob.glob(os.path.join(os.getcwd(), '*.txt')):
      for line in reader: 
          line2 = line.replace('&lt;[1&gt; ', '')
          line = line2.replace('&lt;/[1&gt; ', '')
          line2 = line.replace('&lt;[1&gt;', '')
          line = line2.replace('&lt;/[1&gt;', '')
          
          print line
  </code></pre>
  <p>I've also tried this (but it seems like I'm using the wrong regex syntax):</p>
  <pre><code>        line2 = line.replace('&lt;[*&gt; ', '')
          line = line2.replace('&lt;/[*&gt; ', '')
          line2 = line.replace('&lt;[*&gt;', '')
          line = line2.replace('&lt;/[*&gt;', '')
  </code></pre>
  <p>I dont want to hard-code the <code>replace</code> from 1 to 99.</p>