Introducing Regular Expressions

by
Edition: 1st
Format: Paperback
Pub. Date: 2012-07-31
Publisher(s): Oreilly & Associates Inc
  • Free Shipping Icon

    This Item Qualifies for Free Shipping!*

    *Excludes marketplace orders.

List Price: $52.49

Buy New

Arriving Soon. Will ship when available.
$49.99

Rent Book

Select for Price
There was a problem. Please try again later.

Rent Digital

Rent Digital Options
Online:1825 Days access
Downloadable:Lifetime Access
$40.79
$40.79

Used Book

We're Sorry
Sold Out

How Marketplace Works:

  • This item is offered by an independent seller and not shipped from our warehouse
  • Item details like edition and cover design may differ from our description; see seller's comments before ordering.
  • Sellers much confirm and ship within two business days; otherwise, the order will be cancelled and refunded.
  • Marketplace purchases cannot be returned to eCampus.com. Contact the seller directly for inquiries; if no response within two days, contact customer service.
  • Additional shipping costs apply to Marketplace purchases. Review shipping costs at checkout.

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.

An electronic version of this book is available through VitalSource.

This book is viewable on PC, Mac, iPhone, iPad, iPod Touch, and most smartphones.

By purchasing, you will be able to view this book online, as well as download it, for the chosen number of days.

Digital License

You are licensing a digital product for a set duration. Durations are set forth in the product description, with "Lifetime" typically meaning five (5) years of online access and permanent download to a supported device. All licenses are non-transferable.

More details can be found here.

A downloadable version of this book is available through the eCampus Reader or compatible Adobe readers.

Applications are available on iOS, Android, PC, Mac, and Windows Mobile platforms.

Please view the compatibility matrix prior to purchase.