[Python-bugs-list] [Bug #130748] re punts on "^*"

noreply@sourceforge.net noreply@sourceforge.net
Thu, 01 Feb 2001 15:00:10 -0800


Bug #130748, was updated on 2001-Feb-01 13:53
Here is a current snapshot of the bug.

Project: Python
Category: Regular Expressions
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Submitted by: dspguru
Assigned to : effbot
Summary: re punts on "^*"

Details: I don't know if this is a "bug" or it's a "just don't do that",
but here's something I just learned not to accidently do:

ActivePython 2.0, build 202 (ActiveState Tool Corp.)
based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC 32 bit (Intel)] on
win32
Type "copyright", "credits" or "license" for more information.
>>> import re
>>> r = re.compile('^*')
>>> s = 'asdf'
>>> r.match(s)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
RuntimeError: maximum recursion limit exceeded

I guess in an ideal world, this would somehow be trapped out in re's
compilation process (though maybe that would cause more overhead than it's
worth.)

special-cases-aren't-special-enough-to-trap-out
though-safety-beats-speed-ly y'rs,

=g2

For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=130748&group_id=5470