Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regexp problem

by jethro (Monsignor)
on Aug 28, 2012 at 13:35 UTC ( #990247=note: print w/ replies, xml ) Need Help??


in reply to Regexp problem

perl -e 'if ("26-04"=~/\d{2}[\-._]\d{2}([\-._]\d{2})*/) { print "yes\n +" }' #prints yes

Seems to work. No need to escape the '-' as it would not be used as range character when it is the first character in a character class

PS: Use <c>-tags around your regex so that it gets displayed correctly in the browser


Comment on Re: Regexp problem
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2015-07-31 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (282 votes), past polls