Although you have correctly made your regex non-greedy, it "can't get a match" because 1nd (in the regex) does not match 1st (in the data):
cheerfully spits outmy $output = "<!-- 1st table -->What I want 1<!-- /1st table -->more s +tuff...<!-- 2st movie -->What I want 2<!-- /2st movie -->...more stuf +f...<!-- 3st movie -->What I want 3<!-- /3st movie -->...more stuff"; if ($output =~ /<!-- 1st table -->(.*?)<!-- \/1st table -->/g) { print $1; } else{ print "Nothing Here!"; }
perl 23.plHowever
What I want 1
In reply to Re: Pattern Search on HTML source.
by ww
in thread Pattern Search on HTML source.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |