Philipp Thomas wrote: > * Jim Meyering (j...@meyering.net) [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.