Mastering Python regular expressions 9781783283156, 1783283157, 9781306463683, 1306463688, 9781783283163, 1783283165

In DetailRegular expressions are used by many text editors, utilities, and programming languages to search and manipulat

232 77 974KB

English Pages 110 Year 2014

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
Cover
Copyright
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Table of Contents
Preface
Chapter 1: Introducing Regular Expressions
History, relevance, and purpose
The regular expression syntax
Literals
Character classes
Predefined character classes
Alternation
Quantifiers
Greedy and reluctant quantifiers
Boundary Matchers
Summary
Chapter 2: Regular Expressions with Python
A brief introduction
Backslash in string literals
String Python 2.x
Building blocks for Python regex
RegexObject
Searching
Modifying a string
MatchObject
group([group1 ...]). Overlapping groupsSummary
Chapter 4: Look Around
Look ahead
Negative look ahead
Look around and substitutions
Look behind
Negative look behind
Look around and groups
Summary
Chapter 5: Performance of Regular Expressions
Benchmarking regular expressions with Python
The RegexBuddy tool
Understanding the Python regex engine
Backtracking
Optimization recommendations
Reuse compiled patterns
Extract common parts in alternation
Shortcut to alternation
Use non-capturing groups when appropriate
Be specific
Don't be greedy
Summary
Index.

Mastering Python regular expressions
 9781783283156, 1783283157, 9781306463683, 1306463688, 9781783283163, 1783283165

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers