package tyre
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=63ca1915da896640534b5cf928d220198709ec74b899d55b830fb0ceccebd633
sha512=536440d090046569449c7752315d568b3447e84c8c0e555a35a20a504a96a538ed9bc4e8e5f78e5860744ba863023331aa0a9893bf2028ae280cad678ec8d59c
doc/tyre/Tyre/Charset/index.html
Module Tyre.Charset
Sets of characters
Sets of characters support more operations than regular regexps, as you can diff them, so they have a specific type that allows these operations.
To convert to a regular Tyre.t, use charset or rep_charset
val char : char -> tThe singleton set
val range : char -> char -> trange of characters ordered according to their code. Include both bounds.
val set : string -> tany character in the string
Predefined character sets
In general, matches latin1 characters, thats is the ocaml Stdlib.char type.
The exact characters matched are not documented in Re, the documentation bellow was written using the source: https://ocaml.orange/p/re/latest/doc/src/re/cset.ml.html .
val any : tany character including newline
val notnl : tany character except a new line
val ascii : tchars with code 0 to 127, bounds included
val blank : tblank is a space ' ' or a tab \t.
val cntrl : tcontrol characters. union of range '\000' '\031' and rg '\127' '\159'.
val digit : tdigit is set "0123456789"
val graph : tunion of range '\033' '\126' and range '\160' '\255'
val lower : tlower is lowercase latin1 letter.
Includes range 'a' 'z', char 'µ', range '\223' '\246' = set "ßàáâãäåæçèéêëìíîïðñòóôõö" and range '\248' '\255' = set "øùúûüýþÿ"
val print : tprintable latin1 characters. range '\032' '\126' || range '\160' '\255'
val punct : tlatin1 ponctuation.
set "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\160¡¢£¤¥¦§¨©«¬\173®¯°±²³´¶·¸¹»¼½¾¿×÷"val space : tspace is set " \t\n\013"
val upper : tupper is latin1 uppercase letter. This includes ascii uppercase letters, that is range 'A' 'Z', but also the ranges range '\192' '\214' = set "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ" and range '\216' '\222' = set "ØÙÚÛÜÝÞ"
val xdigit : thexadecimal digit. range '0' '9' || range 'a' 'f' || range 'A' 'F'