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

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

\w+ in gawk 3.1.3


From: Aharon Robbins
Subject: \w+ in gawk 3.1.3
Date: Wed, 14 Jan 2004 11:32:35 +0200

Greetings.  This is indeed a bug.  Thanks for reporting it.
I will shortly post a fix for 3.1.3, and make sure that it's
fixed in 3.1.4 and that the test suite tests for it.

Thanks!

Arnold Robbins

> From: Ron Burk <address@hidden>
> To: <address@hidden>
> Date: Tue, 13 Jan 2004 20:13:01 -0800
>
> Gawk 3.1.3, compiled with gcc 2.96 on RedHat Linux 7.2
>
> Based on the documentation,
> found it confusing that "\w+" does not match identifiers
> containing digits. Specifically, this pattern:
>
> /^\w+$/
>
> will match a line containing only "func", but not
> one containing "func2". Since the documentation
> implies a similarity between "\w" and "[[:alnum:]_]",
> I also find it confusing that this pattern:
>
> /^[[:alnum:]_]+$/
>
> *does* match a line containing either "func" or
> "func2".
>
> If the documentation is correct in claiming that
> "\w" is *supposed* to also match digits, not
> just alphabetics and "_", then this seems like
> a bug. I went to the source code and in the
> "\w" code that pokes in a "_" to the bitset,
> I added similar pokes for '0' through '9'.
> That seemed to produce the documented behavior,
> though I'm sure it is unlikely to be the best
> way to fix it.
>
> Thanks.




reply via email to

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