OReilly - Mastering Regular Expressions.pdf

(5924 KB) Pobierz
Mastering Regular Expressions - Table of Contents
Mastering Regular Expressions - Table of Contents
Table of Contents
Tables
Preface
1 Introduction to Regular Expressions
2 Extended Introductory Examples
3 Overview of Regular Expression Features and Flavors
4 The Mechanics of Expression Processing
5 Crafting a Regular Expression
6 Tool-Specific Information
7 Perl Regular Expressions
A Online Information
B Email Regex Program
Index
81440858.001.png
Mastering Regular Expressions
Powerful Techniques for Perl and Other Tools
Jeffrey E.F. Friedl
O'REILLY
Ô
Cambridge
·
Köln
Paris
·
Sebastopol
·
Tokyo
[PU]O'Reilly[/PU][DP]1997[/DP]
·
Page iv
Mastering Regular Expressions
by Jeffrey E.F. Friedl
Copyright © 1997 O'Reilly & Associates, Inc. All rights reserved.
Printed in the United States of America.
Published by O'Reilly & Associates, Inc., 101 Morris Street, Sebastopol, CA
95472.
Editor: Andy Oram
Production Editor: Jeffrey Friedl
Printing History:
January 1997:
First Edition.
March 1997:
Second printing; Minor corrections.
May 1997:
Third printing; Minor corrections.
July 1997:
Fourth printing; Minor corrections.
November 1997:
Fifth printing; Minor corrections.
August 1998:
Sixth printing; Minor corrections.
December 1998:
Seventh printing; Minor corrections.
Nutshell Handbook and the Nutshell Handbook logo are registered trademarks
and The Java Series is a trademark of O'Reilly & Associates, Inc.
Many of the designations used by manufacturers and sellers to distinguish their
products are claimed as trademarks. Where those designations appear in this
book, and O'Reilly & Associates, Inc. was aware of a trademark claim, the
designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the
publisher assumes no responsibility for errors or omissions, or for damages
resulting from the use of the information contained herein.
Page V
Table 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-Expression Frame of Mind
6
Searching Text Files: Egrep
7
Egrep Metacharacters
8
Start and End of the Line
8
Character Classes
9
Matching Any Character—Dot
11
Alternation
12
Word Boundaries
14
In a Nutshell
15
Optional Items
16
Other Quantifiers: Repetition
17
Ignoring Differences in Capitalization
18
Parentheses and Backreferences
19
The Great Escape
20
Expanding the Foundation
21
Linguistic Diversification
21
The Goal of a Regular Expression
21
A Few More Examples
22
Zgłoś jeśli naruszono regulamin