Anyone who has used Python to search text for substring patterns has at least heard of the regular expression module. Many of us use it extensively for parsers and lexers, extracting information .
And yet we know surprisingly little about its inner workings, as Armin Ronacher demonstrated in his recent blog post, “Python’s Hidden Regular Expression Gems”. Inspired by this, I want to dive deeper into Python’s re
module and share what I find with folks at EuroPython. My goal is that at the end of the day most of us walk away from this talk with a better understanding of this extremely useful module.
Here are a few examples of the kinds of things I would like to cover:
re
’s overall structure.re.compile
?re.sub
?group
vs. groups
vs groupdict
To keep the talk entertaining as well as educational I plan to pepper it with whatever interesting and/or funny trivia I find about the module’s history and structure.
Prerequisites:
If you’ve ever used the re
module, you should be fine :)