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

Re^3: Regex partial/leading match

by RichardK (Parson)
on Dec 31, 2015 at 23:37 UTC ( [id://1151646]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Regex partial/leading match
in thread Regex partial/leading match

Part of your problem here, is that you have more information than you're giving the computer. i.e. they're not just regex but file system path expressions.

You might take advantage of that knowledge and decompose the regex into a set of File::Find::Rule rules, obviously you'll have to write the parser youself, but hopefully all the regexes will be quite similar and there will be common patterns that you can spot and translate into rules.

So you might end up with something like :-

my @dirs = File::Find::Rule->directory()->name(qr/blah[0-9]/)->in(' +C:\\Windows\\Program Files'); my @files = File::Find::Rule->file()->name('setup.exe')->in(@dirs);

It's an interesting problem and well worth spending some time on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found