On Saturday 12 June 2004 01:10, you wrote:
> I reproduced the problem.  My default locale is en_US.UTF-8.
>
> When I use:
>
>    LC_ALL=en_US.iso-8859-8 egrep -n '[A-Z]'
>
> the lowercase letters are not matched.
>
> It is still mysterious to me why egrep (or grep) folds lowercase into
> uppercase when the locale is UTF-8.
>

A workaround (for the entire alphabet range, at least) is to use the POSIX 
[:upper:] character class:

<<<
$ LC_CTYPE=en_US.UTF-8 grep -n '[[:upper:]]'
hello
A65
2:A65
ANC
3:ANC
>>>

But this may match uppercase letters with accents. (don't know - I haven't 
tried yet).

Regards,

        Shlomi Fish


-- 

---------------------------------------------------------------------
Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://shlomif.il.eu.org/

Quidquid latine dictum sit, altum viditur.
        [Whatever is said in Latin sounds profound.]

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to