my string format are in M/d/yyyy. Which means there will be no zero in front of the month and date digit.
example: 9/23/2012, 7/9/2012 etc
I have tried:
^((((0?[1-9]|[12]\d|3[01]).-/.-/)|((0?[1-9]|[12]\d|30).-/.-/)|((0?[1-9]|1\d|2[0-8])[.-/]0?2.-/)|(29[.-/]0?2.-/))|(((0[1-9]|[12]\d|3[01])(0[13578]|1[02])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|[12]\d|30)(0[13456789]|1[012])((1[6-9]|[2-9]\d)?\d{2}))|((0[1-9]|1\d|2[0-8])02((1[6-9]|[2-9]\d)?\d{2}))|(2902((1[6-9]|[2-9]\d)?(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)|00))))$
but i guess this is for d/M/yyyy.
Anyone have the expression for M/d/yyyy?
If you are trying to validate if the Date is in format
M/d/yyyythen DateTime.TryParseExact is a better solution then Regex. Something like.