in reply to multiple matches with regexp
Well, the Perl way is obviously TIMTOWDI, but I have a Perl-ish RegEx way for you ;-):
Hope this helped.
CombatSquirrel.
Entropy is the tendency of everything going to hell.
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 :-).$a="aaaa"; $a=~m/(aa)(?{push @a, $1})(?!)/; print join ( "-", @a );
Hope this helped.
CombatSquirrel.
Entropy is the tendency of everything going to hell.
In Section
Seekers of Perl Wisdom