In the glibc locale definitions, collating elements have a hyphenated name: collating-symbol <zs> collating-element <z-s> from "<U007A><U0073>" and the hyphenated name have to be used in regular expression for [[. .]] to work properly: $ echo '*ch*' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.c-h.]]//' ** $ echo 'ch' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.ch.]]//' sed: -e expression #1, char 12: Invalid collation character However, POSIX 1.2008 says: A collating symbol is a collating element enclosed within bracket-period ( "[." and ".]" ) delimiters. Collating elements are defined as described in Collation Order . Conforming applications shall represent multi-character collating elements as collating symbols when it is necessary to distinguish them from a list of the individual characters that make up the multi-character collating element. For example, if the string "ch" is a collating element defined using the line: collating-element <ch-digraph> from "<c><h>" in the locale definition, the expression "[[.ch.]]" shall be treated as an RE containing the collating symbol 'ch', while "[ch]" shall be treated as an RE matching 'c' or 'h' . Collating symbols are recognized only inside bracket expressions. If the string is not a collating element in the current locale, the expression is invalid. POSIX especially mentions [[.ch.]] in the example instead of [[.ch-digraph.]] so this is a bug in glibc. It shouldn't be hard to fix it in regcomp.
> POSIX especially mentions [[.ch.]] in the example instead of [[.ch-digraph.]] > so this is a bug in glibc. It shouldn't be hard to fix it in regcomp. The easiest fix would be, in my opnion, to rename all the collation-element names for digraphs from their hyphenated form to the non-hyphenated form. But a few users may have gotten used to using the hyphented forms, working around this bug in glibc. They would be pissed. So for quite a while both forms will have to recognized. Attached patch is an attempt to do this -- when the user specifies [.xx.], it will first try to look up "xx" in the table of collation elements, and when that fails, it will look up "x-x". Is this what you had in mind, Paolo?
Created attachment 6843 [details] seek also the hyphenated form of a collation-element name (Untested patch. I'm just majorly annoyed that collation elements don't work as one would expect from the documenmtation.)
Fixed in 2.18.
*** Bug 260998 has been marked as a duplicate of this bug. *** Seen from the domain http://volichat.com Page where seen: http://volichat.com/adult-chat-rooms Marked for reference. Resolved as fixed @bugzilla.