In python how can I add a special case to a regex function?
<p>Say for example I want to remove the following strings from a string: </p>

<pre><code>remove = ['\\u266a','\\n']
</code></pre>

<p>And I have regex like this:</p>

<pre><code>string = re.sub('[^A-Za-z0-9]+', '', string)
</code></pre>

<p>How can I add "remove" to my regex function?</p>

<p>No need for a special case. Just call re.sub in a loop for each member of your remove list.</p>

python regex