[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: match finds wrong space.
From: |
Davide Brini |
Subject: |
Re: match finds wrong space. |
Date: |
Wed, 7 Jul 2010 19:36:19 +0100 |
On Wed, 07 Jul 2010 21:34:25 +0300 Aharon Robbins <address@hidden> wrote:
> > 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.
But it's matched in his example.
> So, there's no bug.
He is saying that
match( s, /\040[a-z]/ )
on the line
"Mary Ann jane"
gives 5 (meaning [a-z] matches the "A"), whereas it should give 9.
I explained the reason for that in my post.
--
D.