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
In reply to Re: Regexp problem
by jethro
in thread Regexp problem
by agaved
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |