Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: REGEX or Not to REGEX for many items

by dmlond (Acolyte)
on Oct 26, 2009 at 14:20 UTC ( #803275=note: print w/ replies, xml ) Need Help??


in reply to REGEX or Not to REGEX for many items

I cant comment on KinoSearch, as I have never used it myself. It sounds like it is an ideal tool for what you are wanting to do. That being said, given that you are starting from the position of having a bunch of perl scripts, each having its own REGEX defined in them, it would probably be an improvement for you in the short term (at least from a manageability standpoint) to simply coalesce these scripts into a single script defining the REGEXes into an array of qr/$term/ entries, and loop over this array for each file.

@matches = (qr/term1/, qr/term2/, qr/term3/,...);

You might also find Ack useful, as you might be able to program your list of terms against an instance of an Ack object.


Comment on Re: REGEX or Not to REGEX for many items
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2014-08-01 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (36 votes), past polls