In HTML5, form Input fields have three built-in forms of validation;
The input type indicates the type of data expected, and is a good first-line-of-defense. On some browsers- particularly mobile browsers- it will also change the UI/UX of that input to work best for that device.
Indicates whether the form can be submitted with the field left blank.
Offers a much more complex pattern-matching approach. Regex syntax is very picky and can be difficult to code and debug, but a good regex is hugely helpful in validating your inputs.