News for hackers. Stuff that matters.
Re:Glibc: [0-9] matches ¼ ١ 2 〣 and others, but not 9 (and o... by zeroimpl on Thursday July 19, 2018 @10:42AM (#17566727)
This suggests the only safe portable way to represent hex is one of these? [1234567890abcdefABCDEF] or [\dabcdefABCDEF] That sucks. Fortunately I don't use C, but I'm worried about this finding its way into other languages...
Re:Glibc: [0-9] matches ¼ ١ 2 〣 and others, but not 9 (and o... by js2 on Thursday July 19, 2018 @11:12AM (#17567045)
For a POSIX regex, the correct way to match a hex digit is to use is [[:xdigit:]].
Re:Glibc: [0-9] matches ¼ ١ 2 〣 and others, but not 9 (and o... by zeroimpl on Thursday July 19, 2018 @07:59PM (#17571411)
Right - would be great if more languages supported that, specifically Javascript.
Re:Glibc: [0-9] matches ¼ ١ 2 〣 and others, but not 9 (and o... by js2 on Friday July 20, 2018 @11:48AM (#17575987)
Javascript defines regex ranges in terms of UTF-16 code units w/no consideration for locale, so you can use [a-fA-F0-9] and it will work as expected.

The issue discussed in this bug is only relevant to POSIX regular expression ranges.

Perhaps you're lamenting that there are so many different flavors of regular expression. I agree. Just the other day I had to give up on using a regex in a CloudFormation template to validate input because I could not get it to work as documented.