Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Optimizing many many regex matches

by grinder (Bishop)
on Oct 22, 2006 at 20:16 UTC ( [id://579896]=note: print w/replies, xml ) Need Help??


in reply to Optimizing many many regex matches

BUU, what you want is Regexp::Assemble, and create a pattern in "tracked" mode. This will allow you to assemble a single pattern against which to test strings. Big efficiency gain there.

You can then recover the original pattern that triggered the match, use that as a key into a dispatch table, passing in the captured fields. Have a look at eg/ircwatcher to get some ideas. A more advanced version appeared in Perl Hacks, if you happen to have a copy lying around.

• another intruder with the mooring in the heart of the Perl

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-18 17:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found