Message18411
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
length).
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:16 | admin | link | issue814253 messages |
2007-08-23 14:17:16 | admin | create | |
|