python - how to match and exclude regex? -
i have unstructured text need match each td city , whatever text has next city, not include last td city, last 1 next , on: example: (i need text starting <tr><td class="city" till before next <tr><td class="city")
<tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="bloomington"><h2>bloomington</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td>rwerjlkrw</tr> <tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="abb"><h2>abb</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td><class type></tr> <tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="acc"><h2>acc</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td><tr>fdf</tr></tr>
the text
<tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="bloomington"><h2>bloomington</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td></tr><tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="abb"><h2>abb</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td></tr><tr><td class="city" colspan="6"><p><a href="#home">top</a><br /><br /><a name="acc"><h2>acc</h2></a></p></td></tr><tr><td class="blank"> </td><td class="day" colspan="5">monday</td></tr>
Comments
Post a Comment