7. Forms and Regular Expressions

Regular expressions are an amazingly powerful way to validate and format text strings. Using regular expressions, you can write a line or two of JavaScript code that can accomplish tasks that otherwise would have taken several dozen lines.

A regular expression (often abbreviated as RegExp or called by its synonym grep) is a pattern—written using special symbols—that describes one or more text strings. You use regular expressions to match patterns of text so that your script ...

Get Visual QuickStart Guide: JavaScript, Ninth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.