CodeToad Forums » Perl » Parsing, fish up all between <td> and </td> ... without possibility of confusion.
|
|
|
im trying to get the content within td's.
like, <td>some-stuff-i-want-to-get</td>.
i would use:
my @the_tds_as_list = map { /<td>([^<]+)<\/td>/gi } $the_html;
but the problem is that theres tons of "<something>" units between <td> and </td>
which confuse the outcome because that something starts with an < but then turns out
not to be the </td> i want to end with.
so i would like to be able to fish out... <td>(anything-that-is-not:</td>)</td>
take notice that it must be not the entire five letters "</td>".
Does anybody know how to do that?
|
|
|
the solution is:
my @the_tds_as_list = map { /<td>(.*?)<\/td>/gi } $the_html;
|
|
|
|
|
|
|
// |