GNU bug report logs - #15410
[:alnum:] is not [:alpha:] AND [:digit:]... [:alnum:] is [:alpha:] OR [:digit:]

Previous Next

Package: grep;

Reported by: Nick Aganan <thesysad <at> gmail.com>

Date: Wed, 18 Sep 2013 16:13:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nick Aganan <thesysad <at> gmail.com>
To: bug-grep <at> gnu.org
Subject: [:alnum:] is not [:alpha:] AND [:digit:]... [:alnum:] is [:alpha:] OR
 [:digit:]
Date: Wed, 18 Sep 2013 12:07:00 -0400
[Message part 1 (text/plain, inline)]
[:alnum:] is defined as

Alphanumeric characters: ‘[:alpha:]’ *and* ‘[:digit:]’; in the ‘C’ locale
and ASCII character encoding, this is the same as ‘[0-9A-Za-z]’.



AND = need to satisfy *BOTH* alpha and digit

OR = need to satisfy *EITHER* alpha or digit





It looks like ‘[:alpha:]’ *AND* ‘[:digit:]’ functions as ‘[:alpha:]’ *OR* ‘
[:digit:]’, See example





Example:

# cat /tmp/c

adc

x1y1z123

456



# grep [[:alpha:]] /tmp/c

adc

x1y1z123



# grep [[:digit:]] /tmp/c

x1y1z123

456



# grep [[:alnum:]] /tmp/c

adc

x1y1z123

456





### if [:alnum] functions as ‘[:alpha:]’ *AND* ‘[:digit:]’, it should show
x1y1z123 only
[Message part 2 (text/html, inline)]

This bug report was last modified 11 years and 305 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.