Form tag is one of the key tags
of HTML through which users data are sent on server. While making a form there
are lots of validation implemented to allow valid data only. As a developer we
all know about importance of validation and we do lots of JS code for
validation. Working with JS is not an easy task for beginner.
HTML 5 introduce built in
validation using regular expression using pattern property. If you are using
patter regular expression then this will save your time and it is supported by all
model browsers. So using pattern, you do not to worry about browser
compatibility.
Following code will help you to
understand basics of pattern. Ones you will implement basics then after using
regular expression you will be able to implement complicated validation rule.