package js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=f1215de133867fefdb16e2798a225ee0446469a57462af0deebdd22d2a8d3b94
sha512=610cd22818bc6f0a0163f0eec74f58338e18709a6101639f65e58241a9216ed286c3cb091b41e36a82c926de5f030d718a6e76a493e885e61456047a8da153c9
doc/js_of_ocaml/Js_of_ocaml/Regexp/index.html
Module Js_of_ocaml.Regexp
Source
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.
regexp_string s
creates a regexp matching the exact string s
.
Same as regexp_string
but matching will be performed in a case insensitive way.
Functions
string_match r s i
matches the string s
starting from the i
th character. Evaluates to None
if s
(from the i
th character) doesn't match r
.
search r s i
evaluates to the index of the match and the match result or None
if s
(starting from i
) doesn't match r
.
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
.
split r s
splits the string s
erasing matches with r
. split (regexp " ") "toto tutu tata"
is ["toto";"tutu";"tata"]
.