Perl: the Markov chain saw | |
PerlMonks |
Re: Matching patterns with orby AnomalousMonk (Archbishop) |
on Jun 19, 2018 at 18:32 UTC ( [id://1216961]=note: print w/replies, xml ) | Need Help?? |
Another way:
Update 1: Changed example code slightly so that the test sentence includes all sub-patterns. Update 2: On second thought, the \G .*? part of this regex contributes nothing in this particular application; leaving it out does not change the behavior of the match. As Eily wrote, the /(A|B|C)/g pattern is all you need. Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|