give an re to find every innermost "table" element: innertabdoc = """ <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <a>n</a> </td></tr> </table> </td></tr> </table> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> </td> <td> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> <p>y</p> <td> z</td> </td></tr> </table> </td></tr> </table> </td></tr> <tr><td> <table border="0" cellspacing="0" cellpadding="0"> <tr><td> </td></tr> </table> </td></tr> </table> """
give an re to find every "pre" element directly followed by an "a" element: preadoc = """ <pre> a <i>r</i> n </pre> <pre> <b>l</b> y </pre><a href="#n1"></a> <pre> r </pre> <pre> f <font>g</font> z </pre> <pre> m <i>b</i> u <i>c</i> v </pre><a href="#n2"></a> <pre> u </pre> """ "John Ridley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Could you post some real-world examples of the problems you are trying > to deal with, please? Trying to come up with general solutions for > arbitrarily complex patterns is a bit to hard for me :) -- http://mail.python.org/mailman/listinfo/python-list