← Return to program

Faster, Faster! Improving regex performance with atomic grouping, possessive quantifiers and more!

Saturday 2:50 PM–3:20 PM in Hall A

Greedy, Lazy or Possessive? Improving regex performance with atomic grouping, possessive quantifiers and more!

Regex can be a powerful fuzzy text processing tool. But large data starts to show how regex can be slow. This talk will examine some of the reasons why regex can be slow, and what can be done to improve performance.

Many of the techniques covered are also applicable in other programming tools that use regex.

This is not an introduction to regex talk; an understanding of basic regex, and regex in Python, is assumed.

See this talk and many more by getting your ticket to PyCon AU now!

I want a ticket!

Not every trick will work in every case, but by using these techniques some of the performance issues with regex can be addressed. We will start by looking at some simpler techniques can be used, then dive into more advanced techniques. We will look at: * how regex gets parsed and processed * how to choose quantifiers, character classes and flags for performance * whether to be greedy, lazy or possessive (say what?) * using the new (3.11+) atomic grouping and possessive quantifiers.

Peter Lovett he/him • @PeterL777