Just another Perl shrine | |
PerlMonks |
Re^2: regex pattern matchesby johngg (Canon) |
on Aug 22, 2014 at 12:48 UTC ( [id://1098317]=note: print w/replies, xml ) | Need Help?? |
The angle brackets ('<' & '>') are not regex metacharacters so need not be escaped. Choosing a different pattern delimiter would mean that nothing needs to be, making the pattern a little easier on the eye.
Note also that I capture ([^<]+) because (.*) is greedy.
I hope this is useful. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|