RegularExpressionValidator

M

mConrow

I have a textbox that can take a two-digit number (15-99) OR a date in
mm/dd/yyyy format. The validation expression I am trying to use is:
(([15-99])|((0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/](19|20)\d\d)).
This does not work and the validator is firing even when valid entries are
made. It is clear I have missed something in my formula.
Any help would be much appreciated.
Thank You.
 
M

mConrow

Nevermind. I found the solution
^\d{2}$|^(((0?[1-9]|1[012])/(0?[1-9]|1\d|2[0-8])|(0?[13456789]|1[012])/(29|30)|(0?[13578]|1[02])/31)/(19|[2-9]\d)\d{2}|0?2/29/((19|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(([2468][048]|[3579][26])00)))$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top