Python Regular Expression for a paragraph
<p>Hi i have this as my testing string:</p>

<pre><code>&lt;image&gt;
&lt;title&gt;CNN.com - Technology&lt;/title&gt;
&lt;link&gt;http://www.cnn.com/TECH/index.html?eref=rss_tech&lt;/link&gt;
</code></pre>

<p>and i want to select 'Technology' from it using a python regular expression, however i need it specific so that it uses <code>&lt;image&gt;</code> and <code>&lt;link&gt;</code>. So far the expression i have is:</p>

<pre><code>'&lt;title[^&gt;]*&gt;CNN.com - (.*?)&lt;/title&gt;'
</code></pre>

<p>this expression works to select 'Technology', this is correct however i am unsure how to specialise my code using  <code>&lt;image&gt;</code> and <code>&lt;link&gt;</code> in the expression. For example i need something along the lines of this regular expression <code>'&lt;image&gt;&lt;title[^&gt;]*&gt;CNN.com - (.*?)&lt;/title&gt;&lt;link&gt;'</code> that would actually work to produce the same result of 'Technology?  </p>

<p>If you use the 'single line' option for regex, you name newlines with <code>.</code>. So, you can do:</p>

<pre><code>&lt;image&gt;.&lt;title[^&gt;]*&gt;CNN.com - (.*?)&lt;/title&gt;.&lt;link&gt;
</code></pre>

python regex