[Python-bugs-list] [ python-Bugs-574594 ] Search/Expand fails on 2nd set of [ & ]

noreply@sourceforge.net noreply@sourceforge.net
Thu, 27 Jun 2002 07:04:37 -0700


Bugs item #574594, was opened at 2002-06-27 09:04
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=574594&group_id=5470

Category: Regular Expressions
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Moshe Yudkowsky (myudkowsky)
Assigned to: Fredrik Lundh (effbot)
Summary: Search/Expand fails on 2nd set of [ & ]

Initial Comment:
Search followed by an expand or group() fails to select
any data from the string being searched when 

(a) the search pattern seeks a [ and ] in the string, and

(b) the string contains two pairs of [ and ].

I.e., if the search pattern is 

"\[spam.*\] *(.*)"

and then we search two strings:

str1 = "[spam score 10/10] Spammer Junk"

str2 = "[spam score 10/10] Spammer Junk  [spammer's token]"

we should match, and then be able to expand, the entire
remainder of the string excluding the opening [spam
score.*]. However, this only works for the first
string; the second string fails.

I regret to say that the resolution of this problem is
not obvious from the source file.


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

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