 <p>It's a python code.</p> <pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; s = '&lt;span class="address"&gt;413 W. Street&lt;/span&gt;&lt;br&gt;&lt;span class="phone"&gt;218-999-1020&lt;/span&gt;, &lt;span class="region"&gt;WA&lt;/span&gt; &lt;span class="postal-code"&gt;87112&lt;/span&gt;&lt;br&gt;' &gt;&gt;&gt; re.findall(r'address"&gt;(.*?)&lt;.*phone"&gt;(.*?)&lt;.*region"&gt;(.*?)&lt;.*postal-code"&gt;(.*?)&lt;', s) [('413 W. Street', '218-999-1020', 'WA', '87112')] &gt;&gt;&gt; </code></pre> <h1><a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags">BTW, don't forget to see this</a></h1>