[issue36349] Including parentheses in a regular expression pattern enclosed by literal square bracket characters cause the square brackets not to be matched

Stéphane Wirtel report at bugs.python.org
Mon Mar 18 11:07:34 EDT 2019


Stéphane Wirtel <stephane at wirtel.be> added the comment:

Python 3.7.2 (default, Jan 16 2019, 19:49:22) 
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> s = '[a]'
>>> print(*re.findall(r'\[.*]', s))
[a]
>>> print(*re.findall(r'\[.*]', s))
[a]
>>>

----------

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


More information about the Python-bugs-list mailing list