DEV Community

Discussion on: Regex Bootcamp (or Nobody Seems to be Using HTML5 Validation)

Collapse
 
qm3ster profile image
Mihail Malo • Edited

Sure, and you could even reverse-engineer some messages, but you'd get something like

Phone must begin with "00" or "+" or nothing, followed by "1" or "7" or "20" or "27" or "3...

Whereas with a proper syntax description you could automatically insert a "+", delete a leading "00", and if the following two digits aren't a real country code have an informative error like

Please include the country code in the phone number