tphyahoo has asked for the wisdom of the Perl Monks concerning the following question:
# The special named assertions include: / <before pattern> / # was /(?=pattern)/ / <after pattern> / # was /(?<pattern)/ / <ws> / # match whitespace by :w rules / <sp> / # match a space char The after assertion implements lookbehind by reversing the syntax tree + and looking for things in the opposite order going to the left. It i +s illegal to do lookbehind on a pattern that cannot be reversed.
What does it mean that a pattern cannot be reversed?
Does this have anything to do with the unfortunate situation that variable length lookbehinds are not allowed in Perl 5? Will variable length lookbehinds be allowed in Perl 6? (Though I'm not sure this is even relevant to the concept of pattern reversability, just a guess...)
Googling on this concept was unhelpful.
Thanks for your wisdom!
thomas.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What does it mean that a "pattern cannot be reversed?"
by TimToady (Parson) on Jan 07, 2005 at 00:41 UTC | |
by tphyahoo (Vicar) on Jan 07, 2005 at 13:28 UTC | |
|
Re: What does it mean that a "pattern cannot be reversed?"
by hv (Prior) on Jan 07, 2005 at 13:28 UTC | |
by TimToady (Parson) on Jan 07, 2005 at 16:57 UTC | |
by tphyahoo (Vicar) on Apr 27, 2005 at 14:47 UTC |