Contribute Media
A thank you to everyone who makes this possible: Read More

And now for something completely different.

Description

The goal of this talk is to show the audience a different way of thinking about and developing regex statements.

I have been working with UNIX for decades now and, although i always managed to avoid Perl, i have been intrigued with Regex constructs ever since my first encounter. These weird unreadable things that can transform text like nothing else or can find what i’m looking for in massive files, in no time at all. I’ve created regexes that only appeal to the most nerdiest of nerds and i’ve stunned colleagues by fixing their futile regex attempts in just a few keystrokes. But when Damian Conway showed me how regexes really work i was awestruck. And now i want to share this knowledge.

This talk is aimed at pythonistas that have some experience with the re module. I will take some easy examples and explain in plain english how a regex engine searches for a match. This will show that a regex is not some mysterious incomprehensible pattern description or declarative blueprint. Instead it is a small program that is very good at comparing single characters. Like any programming language it turns out that once you understand the rules and structure it suddenly becomes so much easier to use.

With this new found knowledge we will up the ante and try some more difficult stuff, adding other semantics and some tips and tricks. We’ll look at some pitfalls, maybe compare regex to python solutions and have a look at some regexes found in the wild (either on my drive or on github).

Improve this page