bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] gawk regex ignores case incorrectly for character range


From: Aharon Robbins
Subject: Re: [bug-gawk] gawk regex ignores case incorrectly for character range
Date: Fri, 09 May 2014 15:25:55 +0300
User-agent: Heirloom mailx 12.5 6/20/10

Hi. Thank you for this report.

Technically, it's not a bug, but practically speaking it is. Please see
http://www.gnu.org/software/gawk/manual/html_node/Ranges-and-Locales.html
for the details.

You can work around the problem by setting LC_ALL=C in the environment.

However, as was mentioned, 3.1.5 is pretty old (9 years!) and you should
be using the current one, which is 4.1.1.

Thanks,

Arnold

> From: "Sena, Frederick" <address@hidden>
> To: "address@hidden" <address@hidden>
> Date: Tue, 6 May 2014 23:25:56 +0000
> Subject: [bug-gawk] gawk regex ignores case incorrectly for character range
>
> Hi,
>
> Just wanted  to report a gawk bug in the regex matching for a character
> range.  I found a specific instance where gawk ignores case when it
> should not.
>
> $ awk --version
> GNU Awk 3.1.5
>
> $ env | grep LANG
> LANG=en_US.utf8
>
>
> Examples
>
> 1) Example bug for a regex if it includes a character range it incorrectly
> ignores case.  The output below should not appear because the range does
> not match case.
>
> $ echo hi | awk '/^[A-H]/'
> hi
>
>
> 2) Examples for regex without range.  Notice these correctly match case and 
> nothing is printed.
>
> $ echo hi  | awk '/^H/'
>
> $ echo hi | awk '/^[H]/'
>
>
> Thanks very much,
> --Fred



reply via email to

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