Whats wrong with this regular expression?
Valid input is
- with max and minimum length of 3 and 15 respectively.
when I enter the following valid input, it fails:
preguntado el 01 de febrero de 12 a las 04:02
You don't need comma separators and you don't need to escape all those characters:
You missed space
\s, and no need to use
, in char set.
This will be ok:
\s will match on all whitespace (including tabs and line breaks as well as spaces), if you want just space, change to :
You're missing a space. Try this:
You only need to escape the following characters:
[ \ ^ $ . | ? * + ( )
You also don't need to have
',' between you characters in the set.
\s in you regex, it will cover
remove the commas and you're good to go