Chapter 17. Regular Expressions and Pattern Matching
17.1 What Is a Regular Expression?
A user is asked to fill out an HTML form and provide his or her name, address, and birth date. Before sending the form off to a server for further processing, a JavaScript program checks the form to make sure the user actually entered something, and that the information is in the requested format. We saw in Chapter 11, “Working with Forms and Input Devices,” some basic ways that JavaScript can check form information, but now with the addition of regular expressions, form validation can be much more sophisticated and precise. Regular expressions are also useful ...
Get JavaScript by Example now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.