Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Regex pattern to find directories only with digits

by Krambambuli (Deacon)
on Apr 11, 2013 at 10:23 UTC ( #1028112=note: print w/ replies, xml ) Need Help??


in reply to Regex pattern to find directories only with digits

with this format "20130411". Not "2013.kjh" or "NN.201304", or "2013mmkk04".

You might need to refine your definition of 'this format'. Must it be a valid date ? Can it be in the future ? Can it be anywhere in the past ? Could it be less than 8 digits ? ... Etc. If you'd want _precisely_ 8 digits and wouldn't care about validness of the date,

m/^[\d]{8}$/ might be the regex you want,


Krambambuli

---


Comment on Re: Regex pattern to find directories only with digits
Download Code
Re^2: Regex pattern to find directories only with digits
by Bindo (Acolyte) on Apr 11, 2013 at 11:42 UTC

    Thank you for your thoughts Mr K. Well I just want to find any directory whos names are only made up of digits. It could either be a date, or even just a of a one digit. like 2. Thank you for clarifying doubts so sooner. :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2014-10-31 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (214 votes), past polls