[New-bugs-announce] [issue38660] Checking if two regexes are equal should test if they are functionally equivalent

Борис Верховский report at bugs.python.org
Fri Nov 1 02:22:35 EDT 2019


New submission from Борис Верховский <boris.verk at gmail.com>:

re.compile('([-_.a-zA-Z0-9]+)') == re.compile(r'([-\w.]+)') 

should return True because those are the same regex (\w is a-z, A-Z, 0-9 and the underscore). 

If you want to check if two regexes are identical you would compare the original strings, before re.compile.

----------
components: Regular Expressions
messages: 355791
nosy: boris, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Checking if two regexes are equal should test if they are functionally equivalent
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38660>
_______________________________________


More information about the New-bugs-announce mailing list