Book Description
Scripting and automation tasks often need to extract particular portions of text from input data or modify them from one format to another.
This book will help you learn Python Regular Expressions, a mini-programming language for all sorts of text processing needs.
The book heavily leans on examples to present features of regular expressions one by one. It is recommended that you manually type each example and experiment with them.
You should have prior experience working with Python, should know concepts like string formats, string methods, list comprehension and so on.
Both standard re module and popular third party regex module is covered in this book.
This open book is licensed under a Creative Commons License (CC BY-NC-SA). You can download Python re(gex)? ebook for free in PDF format (0.6 MB).
Table of Contents
Chapter 1
Why is it needed?
Chapter 2
Regular Expression modules
Chapter 3
Anchors
Chapter 4
Alternation and Grouping
Chapter 5
Escaping metacharacters
Chapter 6
Dot metacharacter and Quantifiers
Chapter 7
Working with matched portions
Chapter 8
Character class
Chapter 9
Groupings and backreferences
Chapter 10
Lookarounds
Chapter 11
Flags
Chapter 12
Unicode
Chapter 13
Miscellaneous
Chapter 14
Gotchas