Mastering Python Regular Expressions Illustrated Edition
| Victor Romero (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
About This Book
- Explore the workings of Regular Expressions in Python
- Learn all about optimizing regular expressions using RegexBuddy
- Full of practical and step-by-step examples, tips for performance, and solutions for performance-related problems faced by users all over the world
Who This Book Is For
This 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.
What You Will Learn
- Explore the regular expressions syntax
- Improve the readability and future maintenance of the regex
- Find solutions for typical problems with regular expressions
- Familiarize yourself with match and search operations
- Leverage the look around technique to create powerful regular expressions
- Gain insight on the uses of Groups
- Get to know how the regex engine works through the Backtracking process
- Enhance the performance of your regular expressions
In Detail
Regular 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.
Customers who viewed this item also viewed
Editorial Reviews
About the Author
Victor Romero currently works as a solutions architect at MuleSoft, Inc. He started his career in the dot-com era and has been a regular contributor to open source software ever since. Originally from the sunny city of Malaga, Spain, his international achievements include integrating the applications present in the cloud storage of a skyscraper in New York City and creating networks for an Italian government license in Rome.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Packt Publishing; Illustrated edition (February 21, 2014)
- Language : English
- Paperback : 110 pages
- ISBN-10 : 1783283157
- ISBN-13 : 978-1783283156
- Item Weight : 7.2 ounces
- Dimensions : 7.5 x 0.25 x 9.25 inches
- Best Sellers Rank: #749,399 in Books (See Top 100 in Books)
- #899 in Python Programming
- #1,537 in Software Development (Books)
- #2,130 in Computer Programming Languages
- Customer Reviews:
About the authors

Victor Romero currently works as Solutions Architect at MuleSoft, Inc. He started his career in the dot-com era and has been a regular contributor to open source software ever since. Originally from the sunny city of Malaga, Spain, his International achievements include integrating in to the clouds from a skyscraper in New York City and creating networks for an Italian government licensee in Rome.

Félix López is currently working for ShuttleCloud, an American-based startup, the technology of which is used by institutions such as Stanford and Harvard, and companies such as Google.
He started his career in web development before moving to software in the currency exchange market, where there were a lot of new security challenges. Later, he spent four years doing an IDE to develop games for hundreds of different mobile device OS variations, also creating more than 50 games. Before joining ShuttleCloud, he spent two years working on applications with sensor networks, Arduino, ZigBee and custom hardware. One example detecting the need for streetlight utilities in major cities based on existing atmospheric brightness. His first experience with Python was seven years ago, mostly for small scripts, web scrapping, and so on. Since then, he has used Python for almost all his projects: websites, standalone applications... Nowadays, he uses Python along with RabbitMQ in order to integrate services.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
1- On multiple occasions the authors get ahead of themselves and use syntax or mention topics that have not yet been covered. They sometimes are aware of this and tell the reader to wait for the upcoming chapters, but there are also instances where they simply use them without any further explanation. I think this issue would be resolved if they simply rearrange the order of the chapters.
2- Some of the topics in the books are not explained sufficiently. Be it these are usually topics associated with some of the peculiarities of Python's regex flavor, but when you read these sections you feel that there is still some parts that need to be clarified. Hopefully there aren't many of these instances and usually a simple Googling would suffice to understand them.
In general it's a very good book. It gives a clear picture of Python's regex interface and "re" module. At the end you will learn how to use regular expressions in Python, but to master them you probably need experience coupled with possibly reading a few more advanced books.
Overall I would suggest this book to someone who already has some background in computer science (without it book is Italy fine, but some places might be taken for granted, rather than fully understood). Python knowledge is required, but the very minimum.
I cannot praise this book enough. The well written and clear examples are fantastic. I've been struggling with regular expressions for a while but this book is a god send. Thank you Felix Lopez!!!!!
The book begins with a language independent look at the history and theory of regular expression. It then moves on to using regular expression in Python starting with looking at how strings work in Python, then moving onto look at how to build regular expressions using the re module. The section I found most relevant was how to extract information from a pattern - as I came to learn this is how the code snippet mentioned above worked. After this in depth look at using regular expression in Python, the book takes a brief look at grouping and look around and how to use them before finally looking at techniques for optimizing performance of regular expressions and the potential pitfalls.
This book covered the topic well and I found the book easy to read and follow through. It provided me with all I need to know about regular expression in python and, from what I've seen so far, the concepts are easily transferable to other languages. I also discovered several uses for regular expressions I was not aware of such as being able to split by the appearance of a particular character - something I assume excel does when importing files separated by a tab or comma. Excellent book!










