EuroPython 2016

re-Discovering Python's Regular Expressions

Speaker(s) Ilia Kurenkov

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:

  • A clear presentation of re’s overall structure.
  • What actually happens behind the scenes when you “compile” a regular expression with re.compile?
  • What are the speed implications of using a callable as the replacement argument to re.sub?
  • re.MatchObject interface: 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 :)

in on Tuesday 19 July at 14:30 See schedule

Do you have some questions on this talk?

New comment