[New-bugs-announce] [issue36349] Including parentheses in a regular expression pattern enclosed by literal square bracket characters cause the square brackets not to be matched
Farbod Safe
report at bugs.python.org
Mon Mar 18 11:03:59 EDT 2019
New submission from Farbod Safe <farbod.safe at gmail.com>:
Below two print statements should give the same results but they don't:
import re
s = '[a]'
print(*re.findall(r'\[.*]',s))
[a]
print(*re.findall(r'\[(.*)]',s))
a
----------
messages: 338234
nosy: Farbod Safe2
priority: normal
severity: normal
status: open
title: Including parentheses in a regular expression pattern enclosed by literal square bracket characters cause the square brackets not to be matched
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36349>
_______________________________________
More information about the New-bugs-announce
mailing list