文档介绍:2
Perl, .NET, Java, and More nd Edition
Mastering
Regular
Expressions
Jeffrey . Friedl
, Page 3 Tuesday, July 2, 2002 5:11 PM
Mastering Regular Expressions
Second Edition
Jeffrey E. F. Friedl
Beijing • Cambridge • Farnham • Köln • Paris • Sebastopol • Taipei • Tokyo
Ta ble of Contents
Preface ..................................................................................................................... xv
1: Introduction to Regular Expressions ...................................................... 1
Solving Real Problems ........................................................................................ 2
Regular Expressions as a Language ................................................................... 4
The Filename Analogy ................................................................................. 4
The Language Analogy ................................................................................ 5
The Regular-Expr ession Frame of Mind ............................................................ 6
If You Have Some Regular-Expr ession Experience ................................... 6
Searching Text Files: Egrep ......................................................................... 6
Egr ep Metacharacters .......................................................................................... 8
Start and End of the Line ............................................................................. 8
Character Classes .......................................................................................... 9
Matching Any Character with Dot ............................................................. 11
Alter nation .................................................................................................. 13
Ignoring Differ ences in Capitalization ...................................................... 14
Word Boundaries .................................................