bug-gnulib
[Top][All Lists]
Advanced

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

Re: proposal: make [A-Z] range handling locale-independent


From: Jim Meyering
Subject: Re: proposal: make [A-Z] range handling locale-independent
Date: Thu, 16 Jun 2011 17:42:36 +0200

Philipp Thomas wrote:
> * Jim Meyering (address@hidden) [20110616 11:57]:
>
>> In some locales, the [A-Z] regexp currently matches 25 of the
>> lower case letters.  For example,
>>
>>     $ echo a| LC_ALL=cs_CZ grep '[A-Z]'
>>     a
>>     $ echo y| LC_ALL=cs_CZ grep '[A-Z]'
>>     y
>
> Sorry for chiming in late, but IMO that's why [:upper:] and
> [:lower:] exist and work as expected.

I think that most people reading this do know
about character classes like [:lower:] and [:upper:].
However, I've just checked my shell's history (which goes back years)
and find 483 uses of [a-z] (case-insensitive) and only
37 uses of [:lower:] and [:upper:] (and some of those are tr arguments).
But that's just command-line usage, where I know I have LC_ALL=C.

It's not for nothing: [a-z] is a lot easier/quicker to type
and less esoteric than the likes of [[:lower:]].

> On the other hand, SUSE by default
> ignores locale settings besides LC_CTYPE for root exactly because so many
> scripts blindly assume ASCII locale.



reply via email to

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