Regular expression for validating date in asp net

“31/4/20100”, “31/04/2010” – April has 30 days only 8. “333/2/2008”, “29/02/200a” – day is invalid, year is invalid 7.

Have a look at this screenshot, which shows us that the validator reacts to an impossible date as well: And once again, if the clientside validation is not working, it will be catched in our Code Behind, as shown with the Required Field Validator.If you missed this part, then be sure to check out the first chapters! NET web form will cause your site to throw and unhandled exception. These have special meaning inside a regular expression.Instead of being explicit characters they indicate qualities of the characters or modify the characters being matched by the regular expression.The literal form, shown in the following table, can be used in any place that accepts a variable created with the constructor or created by a literal assignment.


Leave a Reply