You wrote on 05/27/2009 10:50 AM:

> I want to match one <tr>...</tr> pair.
> 
> my code :
> 
> my $pattern = "(<tr (.|\\n)*<\\\/tr>)";
...

> but I got the whole matches instead of one <tr>...</tr> pair each loop.

Do need to de-greedify it.
my $pattern = "(<tr (.|\\n)*?<\\\/tr>)";

This should do the trick.

hth
Alex

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to