bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [gawk] RE bug??


From: Bob Proulx
Subject: Re: [gawk] RE bug??
Date: Thu, 7 Jul 2005 20:45:01 -0600
User-agent: Mutt/1.5.9i

Stephen Davies wrote:
> Stepan Kasal wrote:
> > "Silver" and "Actinium" both match /[[:upper:][:digit:]]+/ and
> > /[A-Z][A-Z0-9]+/
> How do Silver and Actium match  /[A-Z][A-Z0-9]+/ ?
> 
> I agree that my code was the original problem rather than gawk but do 
> not see how the above can match.

It can depending upon your locale setting.  For example on my system:

  echo Silver | LC_COLLATE=en_US awk '/[A-Z][A-Z0-9]+/'
  Silver

And it affects other programs that use the RE library too.

  echo Silver | LC_COLLATE=en_US grep -E '[A-Z][A-Z0-9]+'
  Silver

But of course with LC_COLLATE=POSIX or C then it won't.  So whether it
does or not is actually a it depends upon your locale setting.  Using
the character classes [:upper:] and [:digit:] as you are doing avoids
these issues.

Bob

Attachment: signature.asc
Description: Digital signature


reply via email to

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