[New-bugs-announce] [issue46825] slow matching on regular expression

Heran Yang report at bugs.python.org
Tue Feb 22 05:23:02 EST 2022

New submission from Heran Yang <heran55 at 126.com>:

I'm using `re.fullmatch` to match a string that only contains 0 and 1. The regular expression is: (0+|1(01*0)*1)+

It runs rather slow with Python 3.7, but when I try using regex in C++, with std::regex_constants::__polynomial, it works well.

Would someone take a look at it? Thx.

components: Regular Expressions
files: match.py
messages: 413700
nosy: HeRaNO, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: slow matching on regular expression
type: performance
versions: Python 3.7
Added file: https://bugs.python.org/file50636/match.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list