[Python-bugs-list] [ python-Bugs-456742 ] Failing test case for .*?

noreply@sourceforge.net noreply@sourceforge.net
Wed, 29 Aug 2001 20:04:36 -0700


Bugs item #456742, was opened at 2001-08-29 20:04
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456742&group_id=5470

Category: Regular Expressions
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Darrell Gallion (dgallion)
Assigned to: Fredrik Lundh (effbot)
Summary: Failing test case for .*?

Initial Comment:
The following error is the result of patch 101612   
Which tries to fix recursion limits in sre.
>>> s="""a\nb\n1"""
>>> re.findall("[^\n]+?\d", s)
['a\nb\n1']

A less than optimal work around makes sure a 
simple '.' is being searched for.
If it has a chance of being accepted, I'll look for a 
way to remove the recursion for more complex patterns.


line 1105 _sre.c

            /* see if the tail matches */
            state->repeat = rp->prev;
            if (rp->pattern[2] == 65535 && (*(rp-
>pattern+3) == SRE_OP_ANY || *(rp->pattern+3) == 
SRE_OP_ANY_ALL)){
                /* unbounded repeat */
                for (;;) {


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=456742&group_id=5470