[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

Matthew Barnett report at bugs.python.org
Thu Oct 13 19:46:28 CEST 2011


Matthew Barnett <python at mrabarnett.plus.com> added the comment:

The quantifiers use 65535 to represent no upper limit, so ".{0,65535}" is equivalent to ".*".

For example:

>>> re.match(".*", "x" * 100000).span()
(0, 100000)
>>> re.match(".{0,65535}", "x" * 100000).span()
(0, 100000)

but:

>>> re.match(".{0,65534}", "x" * 100000).span()
(0, 65534)

----------
nosy: +mrabarnett

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13169>
_______________________________________


More information about the Python-bugs-list mailing list