On 2010-08-05, at 8:27 am, Aaron Sherman wrote:
> On Thu, Aug 5, 2010 at 7:55 AM, Carl Mäsak <cma...@gmail.com> wrote:
>> 
>> I see this particular thinko a lot, though. Maybe some Perl 6 lint tool or 
>> another will detect when you have a regex containing ^ at its start, $ at 
>> the end, | somewhere in the middle, and no [] to disambiguate.

I think conceptually the beginning and the end of a string feels like a 
bracketing construct (only without symmetrical symbols).  At least that seems 
to be my instinct.  Well, it doesn't in / ^foo | ^bar | ^qux /, but in 
something like /^ foo|bar $/, the context immediately implies a higher 
precedence for ^ and $.  Maybe something like // foo|bar // could work as a 
bracketing version?

> You know, this problem would go away, almost entirely, if we had a :f[ull] 
> adverb for regex matching that imposed ^[...]$ around the entire match. 

I was thinking of that too.

> I suspect :full would almost always be associated with TOP, in fact. Boy am
> I tired of typing ^ and $ in TOP ;-)

Does it make sense for ^[...]$ to be assumed in TOP by default?  (Though not 
necessary if there's a shortcut like //...//.)


-David

Reply via email to