Message18411
| Author |
glchapman |
| Recipients |
| Date |
2003年09月29日.03:31:55 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
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).
|
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 14:17:16 | admin | link | issue814253 messages |
| 2007年08月23日 14:17:16 | admin | create |
|