develooper Front page | perl.perl5.porters | Postings from December 2011

Re: [perl #107262] Unmatched \Q \E in regexp should warn

Thread Previous | Thread Next
From:
Abigail
Date:
December 29, 2011 09:33
Subject:
Re: [perl #107262] Unmatched \Q \E in regexp should warn
Message ID:
20111229173305.GA20488@almanda
On Thu, Dec 29, 2011 at 08:59:01AM -0500, Ricardo Signes wrote:
> * demerphq <demerphq@gmail.com> [2011-12-29T06:08:49]
> > This construct is not regexp specific, and does not warn in other situations.
> > 
> > perl -le'my $x="\Qfoo[]"; print $x'
> > foo\[\]
> > 
> > IMO, not-a-bug.
> 
> Warning on an unmatched \E might make sense.  I'm not sure.  \Q should be
> allowed to end peacefully when the string terminates.


\Q is documented to escape all non letter/digit/underscores to the next
\E or the end of the pattern, whichever comes first.



Abigail

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