[[:alpha:]]、[:space:]]、[[:alnum:]这些到是看过,不知道你说的这个文档是哪里的?

解决方案 »

  1.   

    参见 http://www.opengroup.org/onlinepubs/7908799/xbd/locale.html以下为有关部分的节选:The character sequences: [.   [=    [:
    (left-bracket followed by a period, equals-sign or colon) are special inside a bracket expression and are used to delimit collating symbols, equivalence class expressions and character class expressions. These symbols must be followed by a valid expression and the matching terminating sequence .], =] or :], as described in the following items. 
    A matching list expression specifies a list that matches any one of the expressions represented in the list. The first character in the list must not be the circumflex. For example, [abc] is an RE that matches any of the characters a, b or c. A non-matching list expression begins with a circumflex (^), and specifies a list that matches any character or collating element except for the expressions represented in the list after the leading circumflex. For example, [^abc] is an RE that matches any character or collating element except the characters a, b or c. The circumflex will have this special meaning only when it occurs first in the list, immediately following the left-bracket. A collating symbol is a collating element enclosed within bracket-period ([. .]) delimiters. Collating elements are defined as described in Collation Order . Multi-character collating elements must be represented 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 in the current collation sequence with the associated collating symbol <ch>, the expression [[.ch.]] will be treated as an RE matching the character sequence ch, while [ch] will be treated as an RE matching c or h. Collating symbols will be recognised only inside bracket expressions. This implies that the RE [[.ch.]]*c matches the first to fifth character in the string chchch. If the string is not a collating element in the current collating sequence definition, or if the collating element has no characters associated with it (for example, see the symbol <HIGH> in the example collation definition shown in Collation Order ), the symbol will be treated as an invalid expression. An equivalence class expression represents the set of collating elements belonging to an equivalence class, as described in Collation Order. Only primary equivalence classes will be recognised. The class is expressed by enclosing any one of the collating elements in the equivalence class within bracket-equal ([= =]) delimiters. For example, if a, à and &acirc; belong to the same equivalence class, then [[=a=]b], [[=à=]b] and [[=&acirc;=]b] will each be equivalent to [aà&acirc;b]. If the collating element does not belong to an equivalence class, the equivalence class expression will be treated as a collating symbol. A character class expression represents the set of characters belonging to a character class, as defined in the LC_CTYPE category in the current locale. All character classes specified in the current locale will be recognised. A character class expression is expressed as a character class name enclosed within bracket-colon ([: :]) delimiters.