|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RegularExpressionValidatorI 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. 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)))$
Show quoteHide quote "mConrow" wrote: > 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. > Nevermind. I found the solution: Pretty interesting... uh! :)> ^\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)))$ -- Happy Hacking, Gaurav Vaish | www.mastergaurav.com www.edujinionline.com http://eduzine.edujinionline.com -----------------------------------------
Confirm Message in gridview
NullReferenceException with dynamic DataGrid Custom Control at deisgn time Tree view with XML and Populateondemand Slow File Upload Speed IIS 6.0 ASP.net 2.0 User controls and LoadControl method Newbie ASP.NET question for Webportal project How to use .Net controls in regular ASP RowCommand Event of a nested Gridview XPath Asp.net |
|||||||||||||||||||||||