This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author glchapman
Date 2003-09-29.03:31:55
SpamBayes Score
Marked as misclassified
I was trying to get a pattern like this to work:

   pat = re.compile(r'(?<=(...)\1)abc')
   pat.match('jkljklabc', 6)

Unfortunately, that doesn't work.  The problem is that 
sre_parse.Subpattern.getwidth() ignores GROUPREFs 
when calculating the width, so the subpattern in the 
assertion is deemed to have length of 3 (I was hoping 
that sre could detect that the group 1 had a fixed 
length, so the reference to it would also have a fixed 

I've since discovered that both Perl and PerlRE cannot 
handle the above pattern, but they both generate 
exceptions indicating that the assertion has a variable 
length pattern.  I think it would be a good idea if sre 
generated an exception as well (rather than silently 
ignoring GROUPREFs).

Date User Action Args
2007-08-23 14:17:16adminlinkissue814253 messages
2007-08-23 14:17:16admincreate