YAPC::Europe 2013 in Kiev

YAPC::Europe 2013 “Future Perl”

Twitter #ye2013    Facebook    RSS       Log in

Twitter #ye2013    Facebook    RSS       Log in

Regexes can be simple and fast

By Carl Mäsak (‎masak‎)
Date: Wednesday, 14 August 2013 12:50
Duration: 40 minutes
Target audience: Any
Language: English


I remember learning about regular expressions. They're this very expressive sublanguage, available at the press of the slash key in Perl, which makes a whole lot of tasks more tractable, easy to express, and fun. The syntax is a little quirky, but hey. They're pretty great.

Then I learned about this web page: "Regexes can be simple and fast", which lays out the case for how regexes have been implemented in a horribly inefficient way in Perl, a bastardization of the way they were Meant To Be. It turns out there are things you can do to implement regexes in a much simpler way, and Perl's not doing them. Don't get me wrong: Perl's regexes are *awesome*, with optimizations up the wazoo. But somewhere along the way, they lost the original vision of simplicity and speed.

In this talk, we start over. We'll cook Perl's regexes according to the traditional recipe. Along the way, we'll learn important things about backtracking, composability, and sublanguages, that are useful beyond the domain of regexes. And, not surprisingly, somewhere along the way, we stumble over Perl 6's grammars and declarative prefixes.

Attended by: