9781449392680

Introducing Regular Expressions

by
  • ISBN13:

    9781449392680

  • ISBN10:

    1449392687

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2012-07-31
  • Publisher: Oreilly & Associates Inc
  • Purchase Benefits
  • Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $39.99 Save up to $6.00
  • Buy New
    $33.99

    USUALLY SHIPS IN 3-5 BUSINESS DAYS

Supplemental Materials

What is included with this book?

  • The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
  • The eBook copy of this book is not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Summary

Regular expressions remain a difficult part of the puzzle when learning how to program. Commonly used for sifting through large chunks of text, regexes are incredibly powerful although they may appear daunting to the newcomer. And variations among languages and environments make them even harder to master. Loaded with examples, this introductory guide walks beginners step-by-step through the fundamentals of regular expressions, and helps you decipher complex patterns. Break down regular expressions into comprehensible parts Learn common usage patterns through simple, easy-to-follow examples Discover how finding unique patterns can help you avoid repetitive, hand-editing of text Use common command-line tools such as grep and sed Compare how regular expressions are implemented in different languages and environments

Author Biography

Michael Fitzgerald, a programmer and consultant, has written several technical books for O'Reilly and John Wiley Sons, as well as several articles for the O'Reilly Network. He was a member of the original committee that created the RELAX NG schema language for XML.

Table of Contents

Prefacep. vii
What Is a Regular Expression?p. 1
Getting Started with Regexpalp. 2
Matching a North American Phone Numberp. 2
Matching Digits with a Character Classp. 4
Using a Character Shorthandp. 5
Matching Any Characterp. 5
Capturing Groups and Back Referencesp. 6
Using Quantifiersp. 6
Quoting Literalsp. 8
A Sample of Applicationsp. 9
What You Learned in Chapter 1p. 11
Technical Notesp. 11
Simple Pattern Matchingp. 13
Matching String Literalsp. 15
Matching Digitsp. 15
Matching Non-Digitsp. 17
Matching Word and Non-Word Charactersp. 18
Matching Whitespacep. 20
Matching Any Character, Once Againp. 22
Marking Up the Textp. 24
Using sed to Mark Up Textp. 24
Using Perl to Mark Up Textp. 25
What You Learned in Chapter 2p. 27
Technical Notesp. 27
Boundariesp. 29
The Beginning and End of a Linep. 29
Word and Non-word Boundariesp. 31
Other Anchorsp. 33
Quoting a Group of Characters as Literalsp. 34
Adding Tagsp. 34
Adding Tags with sedp. 36
Adding Tags with Perlp. 37
What You Learned in Chapter 3p. 38
Technical Notesp. 38
Alternation, Groups, and Backreferencesp. 41
Alternationp. 41
Subpatternsp. 45
Capturing Groups and Backreferencesp. 46
Named Groupsp. 48
Non-Capturing Groupsp. 49
Atomic Groupsp. 50
What You Learned in Chapter 4p. 50
Technical Notesp. 51
Character Classesp. 53
Negated Character Classesp. 55
Union and Differencep. 56
POSIX Character Classesp. 56
What You Learned in Chapter 5p. 59
Technical Notesp. 60
Matching Unicode and Other Charactersp. 61
Matching a Unicode Characterp. 62
Using vimp. 63
Matching Characters with Octal Numbersp. 64
Matching Unicode Character Propertiesp. 65
Matching Control Charactersp. 68
What You Learned in Chapter 6p. 70
Technical Notesp. 71
Quantifiersp. 73
Greedy, Lazy, and Possessivep. 74
Matching with *, +, and ?p. 74
Matching a Specific Number of Timesp. 75
Lazy Quantifiersp. 76
Possessive Quantifiersp. 77
What You Learned in Chapter 7p. 78
Technical Notesp. 79
Lookaroundsp. 81
Positive Lookaheadsp. 81
Negative Lookaheadsp. 84
Positive Lookbehindsp. 85
Negative Lookbehindsp. 85
What You Learned in Chapter 8p. 86
Technical Notesp. 86
Marking Up a Document with HTMLp. 87
Matching Tagsp. 87
Transforming Plain Text with sedp. 88
Substitution with sedp. 89
Handling Roman Numerals with sedp. 90
Handling a Specific Paragraph with sedp. 91
Handling the Lines of the Poem with sedp. 91
Appending Tagsp. 92
Using a Command File with sedp. 92
Transforming Plain Text with Perlp. 94
Handling Roman Numerals with Perlp. 95
Handling a Specific Paragraph with Perlp. 96
Handling the Lines of the Poem with Perlp. 96
Using a File of Commands with Perlp. 97
What You Learned in Chapter 9p. 98
Technical Notesp. 98
The End of the Beginningp. 101
Learning Morep. 102
Notable Tools, Implementations, and Librariesp. 103
Perlp. 103
PCREp. 103
Ruby (Oniguruma)p. 104
Pythonp. 104
RE2p. 105
Matching a North American Phone Numberp. 105
Matching an Email Addressp. 105
What You Learned in Chapter 10p. 106
Appendix: Regular Expression Referencep. 107
Regular Expression Glossaryp. 123
Indexp. 129
Table of Contents provided by Ingram. All Rights Reserved.

Rewards Program

Write a Review