type t = charset
val empty : charset
The empty character set.
val full : charset
The full character set.
val singleton : char -> charset
singleton c returns a charset containing only
val range : char -> char -> charset
range cmin cmax returns the charset containing all the characters between
val from_string : string -> charset
from_string s returns the charset corresponding to the description string
s, which may contain standalone characters (different from
'-', which is only allowed as first character) or ranges. They are build of start and end characters, separated by
'-'. An example of a valid description is
"-_a-zA-Z0-9". Note that
Invalid_argument is raised in case of ill-formed description.
union cs1 cs2 builds a new charset that contins the union of the characters of
complement cs returns a new charset containing exactly characters that are not in
add cs c returns a new charset containing the characters of
cs and the character
del cs c returns a new charset containing the characters of
cs but not the character
val mem : charset -> char -> bool
mem cs c tests whether the charset
print oc cs prints the charset
cs to the output channel
oc. A compact format is used for printing: common ranges are used and full and empty charsets are abreviated.
print_full oc cs is the same as
print oc cs but it does not use abreviations (i.e. all characters are displayed).
val show : charset -> string
show oc cs builds a string representing the charset
cs using the same compact format as
val show_full : charset -> string
show_full oc cs is the same as
show oc cs but it does not use abreviations (i.e. all characters appear).
val addq : charset -> char -> unit
addq cs c adds the character
c to the charset
cs. Users must be particularly careful when using this function. In particular, it should not be used directly on
full or the result of the
singleton function as it would change their value permanently. It is advisable to prefer the use of
add or to work on a
val delq : charset -> char -> unit
delq cs c deletes the character
c from the charset
cs. Similar recomendatiosn as for