[issue38660] Checking if two regexes are equal should test if they are functionally equivalent

Serhiy Storchaka report at bugs.python.org
Fri Nov 1 03:20:02 EDT 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

These two regexes are not the same.

>>> re.compile('([-_.a-zA-Z0-9]+)').match('ä')
>>> re.compile(r'([-\w.]+)').match('ä')
<re.Match object; span=(0, 1), match='ä'>

As Ammar said checking that two regexes always matches the same is very difficult problem. It is the problem of determining if two programs are the same.

----------
nosy: +serhiy.storchaka

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


More information about the Python-bugs-list mailing list