| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Character set class. Character set object represents a set of characters. Gauche provides built-in support of character set creation and a predicate that tests whether a character is in the set or not.
Further operations, such as set algebra, is defined in SRFI-14
module (See section srfi-14 - Character-set library).
#[char-set-spec]
You can write a literal character set in this syntax. char-set-spec is a sequence of characters to be included in the set. You can include the following special sequences:
x-yCharacters between x and y, inclusive. x must be smaller than y in the internal encoding.
^If char-set-spec begins with caret, the actual character set is a complement of what the rest of char-set-spec indicates.
\xNNA character whose internal code is a hexadecimal number NN.
\uNNNNA character whose UCS-2 code is a 4-digit hexadecimal number NNNN.
\UNNNNNNNNA character whose UCS-4 code is a 8-digit hexadecimal number NNNNNNNN.
\sWhitespace characters.
\SComplement of whitespace characters.
\dDecimal digit characters.
\DComplement of decimal digit characters.
\wWord constituent characters. Currently, it is alphanumeric characters and underscore.
\WComplement of word constituent characters.
\\A backslash character.
\-A minus character.
\^A caret character.
[:alnum:] …Character set a la POSIX. The following character set name is
recognized: alnum, alpha, blank, cntrl,
digit, graph, lower, print, punct,
space, upper and xdigit.
#[aeiou] ; a character set consists of vowels #[a-zA-Z] ; alphabet #[[:alpha:]] ; alphabet (using POSIX notation) #[\x0d\x0a] ; newline and carriage return #[\\\-] ; backslash and minus #[] ; empty charset |
[SRFI-14] Returns true if and only if obj is a character set object.
[SRFI-14] Returns true if and only if a character set object char-set contains a character char.
(char-set-contains? #[a-z] #\y) ⇒ #t (char-set-contains? #[a-z] #\3) ⇒ #f (char-set-contains? #[^ABC] #\A) ⇒ #f (char-set-contains? #[^ABC] #\D) ⇒ #t |
[SRFI-14] Creates a character set that contains char ….
(char-set #\a #\b #\c) ⇒ #[a-c] |
[SRFI-14] Copies a character set char-set.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on October, 7 2008 using texi2html 1.78.