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.
Approach A short and straight to the point guide that explains the implementation of Regular Expressions in Python.
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.
Mastering Python Regular Expression has a promising title, and I certainly wanted to bring my Python RE skills to true mastery, but I was sorely disappointed by this book. It consists of little more than the authors’ rephrasing of the official Python API documentation. Regular expressions are notoriously complex and require loads of examples and try-it-yourself assignments to get down, but this book only presents each aspect of REs in an extremely concise and deathly boring fashion before moving on. Before you know it, the book has finished (it is only 110 pages!), and you'll hardly be any more comfortable with regex than when you started.
The book definitely has a dodgy air about it. The last part of the book is essentially an advertisement for the commercial software RegexBuddy. I’ll be sure to avoid any offerings from Packt Publishing in the future. As an example of just how little effort was put into this book from the publisher's part, the non-native English of the two Spanish-speaking authors was never polished by an editor. Consequently, the book reads as very unprofessional, sometimes even annoying, e.g. “The IEEE thought their POSIX standard has tried to standardize and give better Unicode support to the regular expression syntax and behaviors. This is called the POSIX flavor of the regular expressions.”
As a general introduction to regular expressions, you would be much better off with O’Reilly's Mastering Regular Expressions (though it uses Perl for teaching, the particular regular-expression dialect it uses is very similar to Python's own). When it comes to exploiting REs in Python, pretty much any API documentation or online tutorial will be just as good, if not much better, than this book.
This book is at least useful: with about 20 pages of it I was able to accomplish my task (to replace a project url in .git/config files ). But I found much more efficient way to learn regexps: practice on HackerRank. So put the book away and solve tutorial-organized challenges.
It is clear a misleading title for this kind of book. It is almost a pocket reference guide with very little examples. I don't believe I mastered anything by reading this book. I only had a glimpse of what I can do with python and RegEx. It would be nicer to have a title like "Presenting Regex with Python". Surely there are much better ways to learn RegEx and this book doesn't add anything more than Python some websites together. RegEx can be a very difficult subject to master and you need more examples and try and error examples to master it. I finished the book and I am not sure that I learned more than a cheatsheet in python could give me.
A succinct, but useful reference to using regular expressions in Python. It makes a good second book on the topic of regular expressions, or a good first book if you generally are familiar but need to learn the python dialect.
Despite being from 2014, the only really dated portion of the book is the Python 2.x references. The book covers Python 3 well, and the Python 3 aspects haven't changed much since then.
This was an easy read. There was nothing new here after I had read the RegexBuddy tutorials. No recursion, no subroutines, no atomic groups, no possessive quantifiers. The most advanced it got was the short overview of look-around assertions.
هل لاحظت عندما تسجل في موقع ويطلب منك إدخال إيميل أو هاتف أو صندوق بريد صحيح ويمنعك من إدخال أي حاجة بالباتنجان؟ كل ذلك يتم في المتصفح نفسه قبل إرسال البيانات إلى الخادم. يتم عبر استخدام تقنية برمجية اسمها Regular Expressions لكن التقنية يمكن استخدامها لتحليل الملفات النصية العادية وليست محصورة في المواقع، كما كانت بدايتها في نظام لينوكس الذي يستخدم سطر الأوامر.
ريغولار إكسبريشنز موجودة في معظم لغات البرمجة، وتقوم بتحليل النصوص عبر كتابة كود بسيط قد يصبح معقدًا كلما كان معيار التحليل أكثر دقة. الجميل في ريغولار إكسبريشنز أنها مستقلة بذاتها، تستطيع إرسال الكود إلى صديقك حتى لو كان يستخدم لغة برمجة مختلفة.
في هذا الكتاب نتعلم تلك التقنية وكيفية كتابتها في لغة بايثون، فلابد من مقدمة في بايثون وأنصح بالقسم الأول من كتاب Python Crash Course by Eric Matthes
Simply an excellent Python regex book. Short and sharp. Read it if you need to become familiar with the topic asap. I recommend to use IPython notebook for book examples, that way you will gain motor memory and create a personal "HowTo" manual.