Leverage regular expressions in Python even for the most complex features<br>Overview<br>Explore the workings of Regular Expressions in Python<br>Learn all about optimizing regular expressions using RegexBuddy<br>Full of practical and step-by-step examples, tips for performance, and solutions for pe
Mastering Python regular expressions
✍ Scribed by López, Félix;Romero, Victor
- Publisher
- Packt Publishing
- Year
- 2014
- Tongue
- English
- Leaves
- 110
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
In DetailRegular expressions are used by many text editors, utilities, and programming languages to search and manipulate text based on patterns. They are considered the Swiss army knife of text processing. Powerful search, replacement, extraction and validation of strings, repetitive and complex tasks are reduced to a simple pattern using regular expressions.Mastering Python Regular Expressions will teach you about Regular Expressions, starting from the basics, irrespective of the language being used, and then it will show you how to use them in Python. You will learn the finer details of what Python supports and how to do it, and the differences between Python 2.x and Python 3.x.The book starts with a general review of the theory behind the regular expressions to follow with an overview of the Python regex module implementation, and then moves on to advanced topics like grouping, looking around, and performance.You will explore how to leverage Regular Expressions in Python, some advanced aspects of Regular Expressions and also how to measure and improve their performance. You will get a better understanding of the working of alternators and quantifiers. Also, you will comprehend the importance of grouping before finally moving on to performance optimization techniques like the RegexBuddy Tool and Backtracking.Mastering Python Regular Expressions provides all the information essential for a better understanding of Regular Expressions in Python.ApproachA short and straight to the point guide that explains the implementation of Regular Expressions in Python.Who this book is forThis book is aimed at Python developers who want to learn how to leverage Regular Expressions in Python. Basic knowledge of Python is required for a better understanding.
✦ 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.
✦ Subjects
Computer Science;Programming;Nonfiction;Technical;Science;Technology;Reference
📜 SIMILAR VOLUMES
<b>Leverage regular expressions in Python even for the most complex features</b><h2>About This Book</h2><ul> <li>Explore the workings of Regular Expressions in Python</li> <li>Learn all about optimizing regular expressions using RegexBuddy</li> <li>Full of practical and step-by-step examples, tip
<b>Leverage regular expressions in Python even for the most complex features</b><h2>About This Book</h2><ul> <li>Explore the workings of Regular Expressions in Python</li> <li>Learn all about optimizing regular expressions using RegexBuddy</li> <li>Full of practical and step-by-step examples, tip
<b>Leverage regular expressions in Python even for the most complex features</b><h2>About This Book</h2><ul> <li>Explore the workings of Regular Expressions in Python</li> <li>Learn all about optimizing regular expressions using RegexBuddy</li> <li>Full of practical and step-by-step examples, tip
"This is the International Edition. The content is in English, same as US version but different cover. Please DO NOT buy if you can not accept this difference. Ship from Shanghai China, please allow about 3 weeks on the way to US or Europe. Message me if you have any questions."