I recently updated my book titled Python re(gex)? and it is free to download till 11-Aug-2019! You can still pay if you wish :)
Get the ebook using either of these sites:
Code snippets, example files, sample chapters, etc are available on GitHub: https://github.com/learnbyexample/py_regular_expressions
This book covers both
re module and the third-party regex module. Examples are used extensively, please follow along by typing them out. Exercises are included to test your understanding and chapters have cheatsheets for easy reference.
Table of Contents
- Why is it needed?
- Regular Expression modules
- Alternation and Grouping
- Escaping metacharacters
- Dot metacharacter and Quantifiers
- Working with matched portions
- Character class
- Groupings and backreferences
- Further Reading
I plan to add more content to the book in future and hopefully create an interactive course. Currently the book is licensed under cc-by-nc-sa with code snippets under MIT and I'll probably add the source files to the repo sometime in the future. I'm generating the PDF using pandoc+xelatex. I plan to create an epub version too and possibly put the book on Amazon Kindle.
Happy learning :)