1. Cover
  2. Buy PDF/EPUB versions
  3. 1. Preface
  4. 2. Why is it needed?
  5. 3. re introduction
  6. 4. Anchors
  7. 5. Alternation and Grouping
  8. 6. Escaping metacharacters
  9. 7. Dot metacharacter and Quantifiers
  10. 8. Interlude: Tools for debugging and visualization
  11. 9. Working with matched portions
  12. 10. Character class
  13. 11. Groupings and backreferences
  14. 12. Interlude: Common tasks
  15. 13. Lookarounds
  16. 14. Flags
  17. 15. Unicode
  18. 16. regex module
  19. 17. Gotchas
  20. 18. Further Reading
  21. 19. Exercise Solutions


  22.    Source code
  23.    My Blog
  24.    My Books
  25.    learnbyexample weekly
  26.    Twitter

Understanding Python re(gex)?

    Buy PDF/EPUB versions

    Purchase links

    You can buy the pdf/epub versions of the book using these links:

    • https://leanpub.com/py_regex
    • https://learnbyexample.gumroad.com/l/py_regex

    Bundles

    You can also get the book as part of these bundles:

    • All books bundle
      • https://leanpub.com/b/learnbyexample-all-books
      • https://learnbyexample.gumroad.com/l/all-books
    • Learn by example Python bundle
      • https://leanpub.com/b/python-bundle
      • https://learnbyexample.gumroad.com/l/python-bundle
    • Awesome Regex
      • https://leanpub.com/b/regex
      • https://learnbyexample.gumroad.com/l/regex

    Testimonials

    I love your books on regex...As a student from the Digital VLSI space, it is indeed useful now and definitely in the future. It's really well written and really easy to understand the examples.

    — feedback on reddit

    Book list

    Here's a list of programming books I've written:

    • Understanding Python re(gex)?
    • Understanding JavaScript RegExp
    • Understanding Ruby Regexp
    • CLI text processing with GNU grep and ripgrep
    • CLI text processing with GNU sed
    • CLI text processing with GNU awk
    • Ruby One-Liners Guide
    • Perl One-Liners Guide
    • 100 Page Python Intro
    • Practice Python Projects
    • CLI text processing with GNU Coreutils
    • Vim Reference Guide
    • Linux Command Line Computing