Regular expression mystery.

From: David Harel (hareldvd_at_nonexisting.hamakor.org.il)
Date: Sat 12 Jun 2004 - 00:48:26 IDT


In the commands below I insert data to grep via standard input and
terminate with <Ctrl-D>. Lines that match the expression are echoed
back. To improve visibility I used -n option so we can see the line
number of the matched line. BUT.
Can anyone explain the following behavior?
Did anyone fiddle with the weight of letters?

Right
==========================================================
[harel_at_harellaptop tmp]$ grep -n '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]'
123
abc
ABC
3:ABC

Wrong
====================================
[harel_at_harellaptop tmp]$ grep -n '[A-Z]'
123
ABC
2:ABC
abc
3:abc

-- 
Thanks.
David Harel,
==================================
Home office +972 4 6921986
Fax:        +972 4 6921986
Cellular:   +972 54 4534502
Snail Mail: Amuka
            D.N Merom Hagalil
            13802
            Israel
Email:      hareldvd_at_ergolight-sw.com
=================================================================
To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il


This archive was generated by hypermail 2.1.7 : Sat 12 Jun 2004 - 01:00:23 IDT