develooper Front page | perl.perl6.language | Postings from February 2005

Re: Common error with | and ^$ in regexps

Thread Previous | Thread Next
From:
Juerd
Date:
February 7, 2005 04:21
Subject:
Re: Common error with | and ^$ in regexps
Message ID:
20050207122100.GC25652@c4.convolution.nl
Nicholas Clark skribis 2005-02-07 12:10 (+0000):
> Will the relative precedence of grouping versus anchors for beginning and
> end of line remain the same in Perl6 rules?

There currently is no such thing as precedence in regexes. Changing this
would make understanding regexes a lot harder, I think.

And now that (?:) is called [], I think teaching how to just do the
right thing is easy enough.

    /^(?:foo|bar|baz)$/

    /^ [ foo | bar | baz ] $/

Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About