FWIW, I agree with you that "anchor" is a misnomer. It gives the impression that when you say /foo$/ that the $ is a fixed location that the RE engine revolves around (which, as you say, is only the case under certain optimizations).

Ideally, in Perl 6, we'll have real anchors ...

I'm not quite sure what you mean, but it sounds like you think we'll have a way to tell the rules engine something like "jump to this point in the input stream and work sideways" or something. I don't think that "anchors" will be any different in perl6 than they are in perl5 except that we'll probably have more of them by default and they'll all be called "zero-width assertions" as is appropriate. It could just be my lack of imagination, but I don't foresee the rules engine having a way to easily switch its directionality for instance; it will still be primarily left-to-right.


In reply to Re: The "anchor" misnomer in regexes by duff
in thread The "anchor" misnomer in regexes by japhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.