![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: multiple matches with regexpby CombatSquirrel (Hermit) |
on Oct 10, 2003 at 20:23 UTC ( #298407=note: print w/replies, xml ) | Need Help?? |
Well, the Perl way is obviously TIMTOWDI, but I have a Perl-ish RegEx way for you ;-):
This uses (?{}) (just a bit of code within a RegEx that is executed whenever the RE engine runs over it) and (?!) (negative look-ahead), so that it always fails (that's a bit of its magic), both explained in perlre. You could say it is ugly, but I personally like it :-). Hope this helped. CombatSquirrel. Entropy is the tendency of everything going to hell.
In Section
Seekers of Perl Wisdom
|
|