bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Does gawk character classes follow this?


From: Peng Yu
Subject: Re: [bug-gawk] Does gawk character classes follow this?
Date: Thu, 14 Feb 2019 05:27:26 -0600

I don't think the gawk manual is clear.

https://www.gnu.org/software/gawk/manual/html_node/Bracket-Expressions.html#Bracket-Expressions

Why not include the definition in the format similar to the following
to make it unambiguous?

[:alnum:]       [a-zA-Z0-9]
[:alpha:]       [a-zA-Z]
[:ascii:]       [\x00-\x7F]
[:cntrl:]  [\x00-\x1F\x7F]

> Why don't you test it and see?

Why don't you make the manual easy to read by making a table similar
to the table in the "Character Classes" section in
https://www.regular-expressions.info/posixbrackets.html

What is the difference between gawk character classes and those
mentioned in that table?

On 2/14/19, address@hidden <address@hidden> wrote:
> Hello.
>
> Peng Yu <address@hidden> wrote:
>
>> Hi,
>>
>> I'd like to make sure the definition of character classes in gawk. Can
>> I use the following link as a reference for the definition?
>>
>> https://www.regular-expressions.info/posixbrackets.html
>
> No. Read The Fine Manual.
>
>> For example, does [:cntrl:] include \x7F?
>
> Why don't you test it and see?
>
>       gawk 'BEGIN { print("\x7F" ~ /[[:cntrl:]]/) }'
>
> Arnold
>


-- 
Regards,
Peng



reply via email to

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