I need to validate Text box in this format (ex:FEB 2014 MMM YYYY).
I am using the following regular expression string
^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)\-\d{4}$
Only issue is that my input is with a 'space' and not '-' i.e. JUN 2012 not JUN-2012
Can someone please amend the above regex to cater for space
Thanks
Try the below regex to match month and year in this
MMM YYYY
format ,DEMO
use
\s
instead of\-
in your regexlike this :
@Avinash is right \s matches
[\r\n\t\f]
better use " " instead.