Message73746
Ah, I see the problem, if ptr is not incremented, then it will keep
matching the first expression, (^z*), so it would have to both 'skip'
the 'a' and NOT skip the 'a'. Hmm. You're right, Matthew, this is
pretty complicated. Now, for your expression, Matthew,
r'(z*)|(^q*)|(\w+)', Perl gives:
"",undef,undef
undef,undef,"abc"
"",undef,undef
Meaning it doesn't even bother matching the ^q* since the ^z* matches
first. This seems the logical behaviour and fits with the idea that a
Zero-Width match would both only match once and NOT consume any
characters. An internal flag would just have to be created to tell the
2 find functions whether the current value of ptr would allow for a "No
Zero-Width Match" option on second go-around. |
|
Date |
User |
Action |
Args |
2008-09-24 18:33:09 | timehorse | set | recipients:
+ timehorse, niemeyer, jfrechet, rsc, mrabarnett |
2008-09-24 18:33:09 | timehorse | set | messageid: <1222281189.05.0.713924310357.issue1647489@psf.upfronthosting.co.za> |
2008-09-24 18:33:08 | timehorse | link | issue1647489 messages |
2008-09-24 18:33:08 | timehorse | create | |
|