fpoyavo
asked on
Regex Date check
Hi Guys,
Need to validate Date mm/dd/yyyy
This one does not work
^(0?[1-9]|[12][0-9]|3[01]) [\/\-](0?[ 1-9]|1[012 ])[\/\-]\d {4}$
Thanks.
Need to validate Date mm/dd/yyyy
This one does not work
^(0?[1-9]|[12][0-9]|3[01])
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
instead, use the ParseExact method:
http://msdn.microsoft.com/en-us/library/w2sa9yss%28v=vs.110%29.aspx
http://msdn.microsoft.com/en-us/library/system.datetime.parseexact%28v=vs.110%29.aspx
you can even validate against several format strings:
http://msdn.microsoft.com/en-us/library/332de853%28v=vs.110%29.aspx