<br><br>No, caret needs backwhacking to be a self-match:<br><br>perl -wle "use re 'debug'; /^^/"<br> Compiling REx "^^"<br> Final program:<br> 1: BOL (2)<br> 2: BOL (3)<br> ....<br>
<br>perl -wle "use re 'debug'; /^\^/"<br> Compiling REx "^\^"<br> Final program:<br> 1: BOL (2)<br> 2: EXACT <^> (4)<br> ....<br><br>-- <br>Charles DeRykus<br>
<br><div class="gmail_quote">On Fri, Aug 21, 2009 at 11:47 PM, Michael R. Wolf <span dir="ltr"><<a href="mailto:MichaelRWolf@att.net">MichaelRWolf@att.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I seem to remember that the meaning of caret in a regex is context-sensitive, and it can be an anchor, a complement, or just (with apologies to Sigmond) a caret.<br>
<br>
My memory is that . Ergo, /^^[^^]^/ would match "beginning of line then caret then anything-but-a-caret then caret". I can't seem to find support for this (long-held) belief. Have I been wrong for this long?<br>
<br>
And while I'm at it, how 'bout dollar? I thought it was an anchor iff it was the last character in the regex, else it introduced a scalar variable for interpolation.<br>
<br>
It seems that the documentation says that caret and dollar are *always* metacharacters. Any ideas how I could have been mislead by a (seemingly) similar set of rules that I may have misinterpreted? Has their meaning changed in previous versions of Perl (or the Perl regex engine)?<br>
<br>
<br>
<br>
-- <br>
Michael R. Wolf<br>
All mammals learn by playing!<br>
<a href="mailto:MichaelRWolf@att.net" target="_blank">MichaelRWolf@att.net</a><br>
<br>
<br>
<br>
<br>
_____________________________________________________________<br>
Seattle Perl Users Group Mailing List<br>
POST TO: <a href="mailto:spug-list@pm.org" target="_blank">spug-list@pm.org</a><br>
SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list" target="_blank">http://mail.pm.org/mailman/listinfo/spug-list</a><br>
MEETINGS: 3rd Tuesdays<br>
WEB PAGE: <a href="http://seattleperl.org/" target="_blank">http://seattleperl.org/</a><br>
</blockquote></div><br>