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

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

Thread Previous
From:
Karl Williamson
Date:
December 29, 2011 15:05
Subject:
Re: [perl #107262] Unmatched \Q \E in regexp should warn
Message ID:
4EFCF20D.4050106@khwilliamson.com
On 12/29/2011 02:31 PM, Eric Brine wrote:
> On Thu, Dec 29, 2011 at 3:54 PM, Ricardo Signes
> <perl.p5p@rjbs.manxome.org <mailto:perl.p5p@rjbs.manxome.org>> wrote:
>
>     * Abigail <abigail@abigail.be <mailto:abigail@abigail.be>>
>     [2011-12-29T12:33:05]
>      > > 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.
>
>     I was pretty sure it was, but didn't find the documentation in the
>     brief look I
>     had before posting.  All I found was talk about \Q..\E pairs, with a few
>     examples that omitted \E.
>
>
> Examples in the documentation are documentation, and \E is omitted in
> all four examples where it could be omitted.
>
> But it could be clarified at little cost.
>
> Current:
>
> \L: lowercase all characters till \E seen
> \U: uppercase all characters till \E seen
> \Q: quote non-word characters till \E
>
> Suggested:
>
> \L: lowercase all characters till \E or end of string
> \U: uppercase all characters till \E or end of string
> \Q: quote non-word characters till \E or end of string
>
> - Eric
>
+1

Thread Previous


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