Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: regular expressions - finding repeats

by ihb (Deacon)
on Feb 27, 2003 at 20:45 UTC ( [id://239250]=note: print w/replies, xml ) Need Help??


in reply to Re: regular expressions - finding repeats
in thread regular expressions - finding repeats

Here's a little attempt to optimize this code. (Not that it's worth optimizing like this since backreferences rule, but anyway... :)) The pattern can be extended to the line below, and as a bonus you get an even uglier expression.   '(?=[A-E])(?:' . join('|',map($_ x 5, qw(A B C D E))) . ')' A side note that actually can be relevant: if you don't rebuild the pattern each time you'll save a lot. And if you use qr// or /o you'll be even happier, usually.

ihb

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://239250]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-24 22:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found