Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990247]
help
Chatterbox?
[Discipulus]: no fear: moonday i'll back (unless a big quake ... ;=)
[Corion]: Discipulus: Being out in nature is great, at least as long as you have a dry place to sleep and a warm fire ;)
[Discipulus]: my whishlist include more "elements" anyway

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2017-02-24 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (353 votes). Check out past polls.