Main Page


This chapter introduced the JavaScript/ECMAScript implementation of regular expressions. It covered
the two ways of declaring regular expressions, Perl-style and with the
constructor, as well as the
various properties and methods that can be used with them.
You learned how to create many different types of regular expressions, ranging from simply using char-
acter literals to using character classes, quantifiers, and groups. Additionally, you learned advanced reg-
ular expression techniques such as alternation, lookaheads, boundaries, and multiline mode.
Finally, the chapter showed you how to use regular expressions to solve a variety of problems, including
validating dates, credit card numbers, and e-mail addresses, as well as how to remove excess white
space and superfluous HTML tags from text.
Regular Expressions
10_579088 ch07.qxd 3/28/05 11:38 AM Page 223

JavaScript EditorFree JavaScript Editor     Ajax Editor