No such thing as a small change | |
PerlMonks |
Re: regular expressions - finding repeatsby BronzeWing (Monk) |
on Feb 26, 2003 at 21:03 UTC ( [id://238913]=note: print w/replies, xml ) | Need Help?? |
Well blokhead already posted what's probably the best answer, and the one that I wanted to give, but I've got to post something. So here: if ($String =~ join('|',map($_ x 5, qw(A B C D E)))) {}Admittedly it takes 3-4 times as long according to benchmark... but it was so much more fun to write ;p. -BronzeWing
In Section
Seekers of Perl Wisdom
|
|