X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-6.8 required=5.0	tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <4CFAD97B.3060101@redhat.com>
Date: Sat, 04 Dec 2010 17:14:51 -0700
From: Eric Blake <eblake@redhat.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.6
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Problem with Bash regex test case sensitivity
References: <4CF96F70.3090507@veritech.com> <AANLkTikQJEJ6kHKZdzzA_YB_DHgZBevCLDKtAEm6ZgBg@mail.gmail.com> <4CF9BA08.8060703@redhat.com> <AANLkTi=pSXnqvF5OsQbaP8nE6sGHsL6crOG3z9D6SzWs@mail.gmail.com> <20101204150642.GA26471@calimero.vinschen.de> <4CFAB766.9030900@veritech.com>
In-Reply-To: <4CFAB766.9030900@veritech.com>
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigCBCFEC5171DF67FD411A5907"
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

--------------enigCBCFEC5171DF67FD411A5907
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 12/04/2010 02:49 PM, Lee Rothstein wrote:
> Therefore, instead of using '[A-Z]' to represent caps, I should
> have used (?) the Posixly Correct, '[:upper:]'.

POSIX 2001 and 2008 says that [A-Z] when used as a glob or as a regex is
defined _only_ in the C locale; in all other locales, it's behavior is
unspecified.  Meanwhile, [[:upper:]] (note the double [ and ]) is
well-defined in all locales (the next version of POSIX will make it more
obvious that [:upper:] might be treated as either [:epru] or
[[:upper:]], if not outright rejected as an error).  It all stems from
the earlier POSIX 1992, which required [A-Z] to match collation order in
all locales.  POSIX 2001 withdrew that requirement based on how many
people it confused, but the damage was already done - it is no longer
portable because of people that literally implemented the older
requirement (bash included).

Now, what would be really nice is if all implementations treated
unspecified behavior for [A-Z] as meaning a sane synonym for
[[:upper:]], but that's not going to happen any time soon.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigCBCFEC5171DF67FD411A5907
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJM+tl7AAoJEKeha0olJ0Nq9ZQIAK3Laj1u99yCWWNSGpLmvbPS
BKE4F9b4J16i9ew0XWEdlS/+fkkOSO4G2LIzVv8BF366oP0gRPjLXz5e1bnD57il
uS0GZ0zXI5AUyNfhdz5ZYEJThkxqKo6OLjvkI3OtA2RGuBchaJC80ej/YVT2J+Ap
eCKC3ykBpD6uA6atfMbxSGxn17We+Hlcl1YBbR67HDW5z5d1ovY/0N/5EBI3aFIt
PlnVUup7jgzscfrFj3og8NzRUBxgvfFilL59oXGqiZRWrc9hXTjCjwp3/gHYswXQ
d8QNc+/5gNAASZxPS3eE15gb1+5OHr/1Lr4xv+kdlWonNPUVMfsUy1dgyNm1brg=
=CYQf
-----END PGP SIGNATURE-----

--------------enigCBCFEC5171DF67FD411A5907--
