Re: RFC 72 (v4) Variable-length lookbehind.

[email protected] (Hugo) Sun, 01 Oct 2000 02:42:48 +0100
Newsgroups perl.perl6.language.regex
Message-ID <[email protected]>
:The original proposal suggested that it would be nice if C<pos> in list
:context were to return the offset into the the target string where
:the match begins, as well as where it ends.  Some people seemed to like
:this idea, so I am leaving it in, even though it no longer has much to
:do with the content of this RFC.

I didn't spot this fragment before. Note that you can get this
with $-[0] (and pos() with $+[0]), though the info is associated
with the last successful match rather than tied to the string.
See @- and @+ in perlvar for the complete details.

Note that this aspect of the proposal needs a MIGRATION section to
add scalar() around existing uses in a list context. Such use is
quite common in parsing contexts; C::Scan does this for example:

    push @out, pos $txt;

Hugo