I’m trying to crete a regex which can accept general SQL / Js date such as:
31 feb 2012
I already made a regex :
(0[1-9]|[12]\d|3[01])[ ]+(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)[ ]+[12]\d{3}$
but how can i tell the regex to ignore the appearence order of the items :
so it can accept :
Apr 31 2010
2010 Apr 31
...
...
One solution using lookahead assertions:
Explanation: