C
cuneyt
Hi,
I would like to process an HTML file in the form
<tr>
row1
</tr>
<tr>
row2
</tr>
The snippet I wrote is
while( $HtmlSource =~ m{<tr>(.*)</tr>}sg ) {
my $r = $1;
print "found: $r\n";
}
But when I run this I get
found:
row1
</tr>
<tr>
row2
How can I modify the regex so that it is not so greedy and pulls one
<tr></tr> pair at a time?
Thanks a lot
Cuneyt
I would like to process an HTML file in the form
<tr>
row1
</tr>
<tr>
row2
</tr>
The snippet I wrote is
while( $HtmlSource =~ m{<tr>(.*)</tr>}sg ) {
my $r = $1;
print "found: $r\n";
}
But when I run this I get
found:
row1
</tr>
<tr>
row2
How can I modify the regex so that it is not so greedy and pulls one
<tr></tr> pair at a time?
Thanks a lot
Cuneyt