evanda at remingtons.org
Fri Dec 19 00:22:54 CET 2003
I'm trying to filter some rows of an html table out, based on their
contents. For input like:
<tr> << want to filter
<td>kittens</td><td>8</td> << this out.
<tr> <td>robots</td><td>8</td> </tr>
I would like to completely remove the (3 line) table row that makes mention
of kittens. The regexp I have tried to use is: r"<tr>.*?kittens.*?</tr>".
When compiled and used with subs("",data), strangely removes everything
from the first "<tr>" to the first "<tr>" after kittens.
That is, the ".*?" notation works in the second half, but not in the first
half. It behaves the same as ".*" should.
evanda at wreck.org
More information about the Python-list