In HTML5 there is a new input field attribute called pattern.
This attribute specifies a regular expression that the <input> element’s value is checked against.
The pattern attribute is available for text, search, url, tel, email, and password field.
If you would like to describe the pattern, to help the user fill the field correctly use the title attribute.
This feature works in Firefox, Opera and Chrome.
Provide a 3 digit number:
Username (at least 8 characters):