New submission from Farbod Safe <farbod.s...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue36349>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to