Table of Contents
Introduction.
1. Introducing Regular Expressions.
Understanding the Need. How Regular Expressions Are Used. So What Exactly Is a Regular Expression? Using Regular Expressions. Before You Get Started. Summary.
2. Matching–Single Characters.
Matching Literal Text. Matching Any Characters. Matching Special Characters. Summary.
3. Matching Sets of Characters.
Matching One of Several Characters. Using Character Set Ranges. "Anything But" Matching. Summary.
4. Using Metacharacters.
Escaping Revisited. Matching Whitespace Characters. Matching Specific Character Types. Using POSIX Character Classes. Summary.
5. Repeating Matches.
How Many Matches? Using Intervals. Preventing Over Matching. Summary.
6. Position Matching.
Using Boundaries. Using Word Boundaries. Defining String Boundaries. Summary.
7. Using Subexpressions.
Understanding Subexpressions. Grouping with Subexpressions. Nesting Subexpressions. Summary.
8. Using Backreferences.
Understanding Backreferences. Matching with Backreferences. Performing Replace Operations. Summary.
9. Looking Ahead and Behind.
Introducing Lookaround. Looking Ahead. Looking Behind. Combining Lookahead and Lookbehind. Negating Lookaround. Summary.
10. Embedding Conditions.
Why Embed Conditions? Using Conditions. Summary.
Appendix A: Regular Expressions in Popular Applications and Languages.
grep. JavaScript. Macromedia ColdFusion. Macromedia Dreamweaver. Macromedia HomeSite (and ColdFusion Studio). Microsoft ASP. Microsoft ASP.NET. Microsoft C#. Microsoft .NET. Microsoft Visual Studio .NET. MySQL. Perl. PHP. Sun Java.
Appendix B: Regular Expression Solutions to Common Problems.
North American Phone Numbers. U.S. ZIP Codes. Canadian Postal Codes. United Kingdom Postcodes. U.S. Social Security Numbers. IP Addresses. URLs. Complete URLs. Email Addresses. HTML Comments. JavaScript Comments. Credit Card Numbers. Summary.
Appendix C: The Regular Expression Tester.
Understanding the Regular Expression Tester Application. Obtaining a Copy of the Application.