Possible Duplicates:
Preg match text in php between html tags
RegEx match open tags except XHTML self-contained tags
I have a large amount of text formatted in the following way:
<P><B>1- TITLE</B>
<P>
<DL><DD> Text text text text text
text text
</DL><P>
<P><B>2 - Title 2</B>
<P>
<DL><DD> Text text text text text
text text Text text text text text
text text Text text text text text
text text
<br><I>Additional irrelevant information</I>
</DL><P>
I'm trying to use PHP's Regexp functions to retrieve the Title-Text value pairs while stripping out the extra characters as well as the irrelevant info that follows some of the text blocks. Preferably I'd like to:
Grab everything between <P><B> and </B>
as the title
Grab all the text between
<DL><DD>
and the next HTML tag (<) as the text, and somehow keep the two associated together for further processing. Any idea how to do this with PHP's Regexp functions?