bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: have you ever mistyped [[:lower:]] as [:lower:] ?


From: Paul Eggert
Subject: Re: have you ever mistyped [[:lower:]] as [:lower:] ?
Date: Wed, 01 Sep 2010 08:56:54 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100713 Thunderbird/3.0.6

On 09/01/2010 07:25 AM, Eric Blake wrote:

> Personally, I'd _like_ to try to get POSIX to allow unspecified behavior
> for a bracket expression that starts and ends with colon,

Likewise.  Thanks for starting the Aardvark at
<http://austingroupbugs.net/view.php?id=305>.

I was amused to see that, under its argument,
grep is already within its rights to reject [:space:]
even when conforming to POSIX.  I'm not sure I
agree with that position, but I do agree
with the proposal.

>>> Ranges like [A-Z] are so common that changing the default
>>> would have far-reaching effects.

No, actually it would be a Good Thing to fix [A-Z] to have
its ASCII meaning even in non-ASCII locales.  GNU Emacs
already does that, to good effect, and would be a
good precedent for grep doing the same thing.

Such a behavior conforms to POSIX, which explicitly
says that [A-Z] has unspecified behavior outside
the POSIX locale.  (See POSIX 9.3.5 point 7 at
<http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05>.)
Users invariably want the Emacs behavior, not the
grep behavior.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]