Think about Loose Coupling | |
PerlMonks |
Re: Regex OR'ingby tye (Sage) |
on Jul 28, 2000 at 03:13 UTC ( [id://24775]=note: print w/replies, xml ) | Need Help?? |
Regex always prefer matches early in the string. For two matches starting at the same point in the string, regex prefers the one matching elements leftmost in an alternation, where alternations early in the regex are more important than those later. To break ties here, the regex prefers longer matches (or shorter matches for non-greedy elements). Whether my snippet of code is of any use to you probably depends on other details you didn't mention.
In Section
Seekers of Perl Wisdom
|
|