| Preface | p. vii |
| What Is a Regular Expression? | p. 1 |
| Getting Started with Regexpal | p. 2 |
| Matching a North American Phone Number | p. 2 |
| Matching Digits with a Character Class | p. 4 |
| Using a Character Shorthand | p. 5 |
| Matching Any Character | p. 5 |
| Capturing Groups and Back References | p. 6 |
| Using Quantifiers | p. 6 |
| Quoting Literals | p. 8 |
| A Sample of Applications | p. 9 |
| What You Learned in Chapter 1 | p. 11 |
| Technical Notes | p. 11 |
| Simple Pattern Matching | p. 13 |
| Matching String Literals | p. 15 |
| Matching Digits | p. 15 |
| Matching Non-Digits | p. 17 |
| Matching Word and Non-Word Characters | p. 18 |
| Matching Whitespace | p. 20 |
| Matching Any Character, Once Again | p. 22 |
| Marking Up the Text | p. 24 |
| Using sed to Mark Up Text | p. 24 |
| Using Perl to Mark Up Text | p. 25 |
| What You Learned in Chapter 2 | p. 27 |
| Technical Notes | p. 27 |
| Boundaries | p. 29 |
| The Beginning and End of a Line | p. 29 |
| Word and Non-word Boundaries | p. 31 |
| Other Anchors | p. 33 |
| Quoting a Group of Characters as Literals | p. 34 |
| Adding Tags | p. 34 |
| Adding Tags with sed | p. 36 |
| Adding Tags with Perl | p. 37 |
| What You Learned in Chapter 3 | p. 38 |
| Technical Notes | p. 38 |
| Alternation, Groups, and Backreferences | p. 41 |
| Alternation | p. 41 |
| Subpatterns | p. 45 |
| Capturing Groups and Backreferences | p. 46 |
| Named Groups | p. 48 |
| Non-Capturing Groups | p. 49 |
| Atomic Groups | p. 50 |
| What You Learned in Chapter 4 | p. 50 |
| Technical Notes | p. 51 |
| Character Classes | p. 53 |
| Negated Character Classes | p. 55 |
| Union and Difference | p. 56 |
| POSIX Character Classes | p. 56 |
| What You Learned in Chapter 5 | p. 59 |
| Technical Notes | p. 60 |
| Matching Unicode and Other Characters | p. 61 |
| Matching a Unicode Character | p. 62 |
| Using vim | p. 63 |
| Matching Characters with Octal Numbers | p. 64 |
| Matching Unicode Character Properties | p. 65 |
| Matching Control Characters | p. 68 |
| What You Learned in Chapter 6 | p. 70 |
| Technical Notes | p. 71 |
| Quantifiers | p. 73 |
| Greedy, Lazy, and Possessive | p. 74 |
| Matching with *, +, and ? | p. 74 |
| Matching a Specific Number of Times | p. 75 |
| Lazy Quantifiers | p. 76 |
| Possessive Quantifiers | p. 77 |
| What You Learned in Chapter 7 | p. 78 |
| Technical Notes | p. 79 |
| Lookarounds | p. 81 |
| Positive Lookaheads | p. 81 |
| Negative Lookaheads | p. 84 |
| Positive Lookbehinds | p. 85 |
| Negative Lookbehinds | p. 85 |
| What You Learned in Chapter 8 | p. 86 |
| Technical Notes | p. 86 |
| Marking Up a Document with HTML | p. 87 |
| Matching Tags | p. 87 |
| Transforming Plain Text with sed | p. 88 |
| Substitution with sed | p. 89 |
| Handling Roman Numerals with sed | p. 90 |
| Handling a Specific Paragraph with sed | p. 91 |
| Handling the Lines of the Poem with sed | p. 91 |
| Appending Tags | p. 92 |
| Using a Command File with sed | p. 92 |
| Transforming Plain Text with Perl | p. 94 |
| Handling Roman Numerals with Perl | p. 95 |
| Handling a Specific Paragraph with Perl | p. 96 |
| Handling the Lines of the Poem with Perl | p. 96 |
| Using a File of Commands with Perl | p. 97 |
| What You Learned in Chapter 9 | p. 98 |
| Technical Notes | p. 98 |
| The End of the Beginning | p. 101 |
| Learning More | p. 102 |
| Notable Tools, Implementations, and Libraries | p. 103 |
| Perl | p. 103 |
| PCRE | p. 103 |
| Ruby (Oniguruma) | p. 104 |
| Python | p. 104 |
| RE2 | p. 105 |
| Matching a North American Phone Number | p. 105 |
| Matching an Email Address | p. 105 |
| What You Learned in Chapter 10 | p. 106 |
| Appendix: Regular Expression Reference | p. 107 |
| Regular Expression Glossary | p. 123 |
| Index | p. 129 |
| Table of Contents provided by Ingram. All Rights Reserved. |