Regular expression for validating date of birth
This is a simple application for beginners that shows how to create validation for Text Boxes using HTML5 and CSS tools.
Happy Coding, Syntax C4*** REMINDER ***If you find this post useful, Please click the ' Mark as Answer' Button.*** DISCLAIMER ***All Code is provided AS IS.** Want Some Useful Sites ** C4 I believe using regular expression would not ensure that valid date are entered (2008-02-30 this would easily be passed by a regex validation)Like syntax4 mention use ajax.
The other issue is that regular expressions don’t deal directly with numbers. That’s because the characters for the digits 0 through 9 occupy consecutive positions in the ASCII and Unicode character tables.
You can’t tell a regular expression to “match a number between 1 and 31”, for instance. See Chapter 6 for more details on matching all kinds of numbers with regular expressions.
Regular expression is a mathematics tools that is used to set a validation.
Step 5 : Now in this step we apply a style of on a form.
We use capturing groups here because you’ll probably want to capture the day and month numbers anyway.