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

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

Re: match finds wrong space.


From: Aharon Robbins
Subject: Re: match finds wrong space.
Date: Wed, 07 Jul 2010 21:34:25 +0300
User-agent: Heirloom mailx 12.4 7/29/08

Greetings. Re this:

> From: "Chris Willis" <address@hidden>
> To: <address@hidden>
> Subject: match finds wrong space.
> Date: Tue, 6 Jul 2010 22:54:33 +0100
>
> Hi
>
> another one, and pretty basic.
>
> The attached snippet sd respond "9 Mary Ann jane", rather than "5
> Mary Ann jane" it actually responds with. In actual practice it was
> particularly difficult as the failure caused an infinite loop.
> 
> On my suspect machine, gawk 3.0.3 gives the right answer. Even there
> 3.1.6 gives the wrong answer.
>
> [.......]
>
> regards - Chris Willis in the UK# insjk.awk
> 
> BEGIN {
>       s = "Mary Ann jane"
>       n = match( s, /\040[a-z]/ )
>       print n, s
>       }

Hi. Current gawk is correct, and 3.0.3 is wrong. You'll note that
following the \040 for a space you have [a-z]. This matches *lower case
letters*; the "A" following the first first is an upper case letter.

So, there's no bug.

Thank you for taking the time to send in a report.

Arnold



reply via email to

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