News for hackers. Stuff that matters.
Re:Glibc: [0-9] matches ¼ ١ 2 〣 and others, but not 9 (and o... by kazinator on Thursday July 19, 2018 @07:20PM (#17571211)
\d is a Perlism.

Yes, [0-9] is supposed to be locale independent, which is related to the fact that ISO C requires the digit characters '0' through '9' to be consecutive.

The same is not true of [A-Z], which doesn't necessarily include just the upper-case English letters from ASCII. It is locale-specific, in fact.

The POSIX digit matcher is [[:digit:]]. It is related to the C isdigit function from <ctype.h>. Those functions have regex counterparts, like isalnum -> [[:alnum:]] and so on.

The way those functions have locale-dependent behavior is linked to how the corresponding regex classes have locale-dependent behavior.

There are no comments on this comment yet.