Page MenuHomePhabricator

Investigate whether Python regex is faster when non-capturing, use consistently.
Open, LowPublic

Description

The manual is explicit that non-capturing, parenthesized groups are not a performance benefit over their capturing brethren.

It should be mentioned that there’s no performance difference in searching between capturing and non-capturing groups; neither form is any faster than the other.

Let's drop the few non-capturing prefixes in revscoring/languages/*, and document before it becomes an anti-pattern.

On the other hand, we might discover that non-capturing does have a benefit, something the Internet anecdotally supports. Either way, make our code consistent.