Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: regexp to check if file name matches pattern

by davido (Cardinal)
on Feb 24, 2009 at 22:34 UTC ( [id://746131]=note: print w/replies, xml ) Need Help??


in reply to Re: regexp to check if file name matches pattern
in thread regexp to check if file name matches pattern

Lol, I had no way of knowing that your date field was "dot delimited." My solution would naturally reject that. Here's a new approach that should do the trick given that new, previously unmentioned requirement.

/^SYS(?:[^%]+%){2,}[\d.]+\.pdf/i

Let me know how that works out. This time I'm specifically allowing the 'dot' delimiter in the date field. This solution is going to result in some backtracking though. It might be better written as:

/^SYS(?:[^%]+%){2,}(?:\d+)(?:.\d+)+\.pdf/i

This will get less backtracking, and thus should be a little more efficient, if that matters.


Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2025-04-20 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.