Message221646
>> (?<=a)(?<=a)(?<=a)(?<=a)
> There are four different points.
> If a1 before a2 and a2 before a3 and a3 before a4 and a4
> before something.
Sorry, that view doesn't make any sense. A successful lookbehind assertion matches the empty string. Same as the regexp
()()()()
matches 4 empty strings (and all the _same_ empty string) at any point.
> Otherwise repetition of assertion has no sense.
As I said before, it's "usually a silly thing to do". It does make sense, just not _useful_ sense - it's "silly" ;-)
> If it has no sense, there should be an exception.
Why? Code like
i += 0
is usually pointless too, but it's not up to a programming language to force you to code only useful things.
It's easy to write to write regexps that are pointless. For example, the regexp
(?=a)b
can never succeed. Should that raise an exception? Or should the regexp
(?=a)a
raise an exception because the (?=a) part is redundant? Etc. |
|
Date |
User |
Action |
Args |
2014-06-26 20:52:25 | tim.peters | set | recipients:
+ tim.peters, ezio.melotti, mrabarnett, py.user, BreamoreBoy, serhiy.storchaka |
2014-06-26 20:52:25 | tim.peters | set | messageid: <1403815945.55.0.407543312954.issue14460@psf.upfronthosting.co.za> |
2014-06-26 20:52:25 | tim.peters | link | issue14460 messages |
2014-06-26 20:52:25 | tim.peters | create | |
|