Python usage of regular expressions
<p>How can I extract <em>string1#string2</em> from the bellow line?</p>

<pre><code>&lt;![CDATA[&lt;html&gt;&lt;body&gt;&lt;p style="margin:0;"&gt;string1#string2&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;]]&gt;
</code></pre>

<p>The # character and the structure of the line is always the same.</p>

<p>If you wish to use a regex:</p>

<pre><code>&gt;&gt;&gt; re.search(r"&lt;p.*?&gt;(.+?)&lt;/p&gt;", txt).group(1)
'string1#string2'
</code></pre>

python regex