Types for regexps.
Warning: the regexp syntax is the javascript one. It differs
from the syntax used by the Str
module from the OCaml standard
library.
The type for regexps.
The type for match result.
Constructors
Same as regexp
but matching will be performed in a case
insensitive way.
Regexp constructor with flag that allow for case-insensitive search or multiline search (the global flag is always set).
Escapes characters with special meaning in the regexp context.
Same as regexp_string
but matching will be performed in a case
insensitive way.
Functions
matched_string r
return the exact substring that matched when evaluating
r
.
matched_group r i
is the i
th group matched. Groups in matches are
obtained with parentheses. Groups are 1-based.
global_replace r s by
replaces all of the matches of r
in s
by by
.
replace_first r s by
replaces the first match of r
in s
by by
.