Re:Regex Isn't Hard (2023)
by comrade1234 on Monday April 21, 2025 @07:05AM
(#43750527)
lol really? Why not? Is that true for all encodings? Is it a bug or a feature? What about a simple character set like gsm-7 Swedish?
[ Parent
| on HN ]
Re:Regex Isn't Hard (2023)
by lalaithion on Monday April 21, 2025 @07:12AM
(#43750584)
The author says “any lowercase character” but they mean “any character between the character ‘a’ and the character ‘z’”, which happens to correspond to the lower case letters in English but doesn’t include ü, õ, ø, etc.
Re:Regex Isn't Hard (2023)
by comrade1234 on Monday April 21, 2025 @08:07AM
(#43750991)
I would expect [a-z] to mean any lowercase in any language, not lowercase but only a to z. So I’d get bitten by that one.
Re:Regex Isn't Hard (2023)
by deciduously on Monday April 21, 2025 @08:21AM
(#43751137)
The letters with diacritics sort lexicographically after 'z', so it does stand to reason they wouldn't appear in that range.
> but they mean “any character between the character ‘a’ and the character ‘z’”, which happens to correspond to the lower case letters in English
‘Only’ in the most commonly used character encodings. In EBCDIC (https://en.wikipedia.org/wiki/EBCDIC), the [a-z] range includes more than 26 characters.
That’s one of the reasons POSIX has character classes (https://en.wikipedia.org/wiki/Regular_expression#Character_c...). [:lower:] always gets you the lowercase characters in the encoding that the program uses.