Module Js_of_ocaml.Regexp
Types for regexps.
val regexp : string -> regexpSimple regexp constructor.
val regexp_case_fold : string -> regexpSame as
regexpbut matching will be performed in a case insensitive way.
val regexp_with_flag : string -> string -> regexpRegexp constructor with flag that allow for case-insensitive search or multiline search (the global flag is always set).
val regexp_string : string -> regexpregexp_string screates a regexp matching the exact strings.
val regexp_string_case_fold : string -> regexpSame as
regexp_stringbut matching will be performed in a case insensitive way.
val string_match : regexp -> string -> int -> result optionstring_match r s imatches the stringsstarting from theith character. Evaluates toNoneifs(from theith character) doesn't matchr.
val search : regexp -> string -> int -> (int * result) optionsearch r s ievaluates to the index of the match and the match result orNoneifs(starting fromi) doesn't matchr.
val matched_string : result -> stringmatched_string rreturn the exact substring that matched when evaluatingr.
val matched_group : result -> int -> string optionmatched_group r iis theith group matched. Groups in matches are * obtained with parentheses. Groups are 1-based.
val global_replace : regexp -> string -> string -> stringglobal_replace r s byreplaces all of the matches ofrinsbyby.
val replace_first : regexp -> string -> string -> stringreplace_first r s byreplaces the first match ofrinsbyby.
val split : regexp -> string -> string listsplit r ssplits the stringserasing matches withr.split (regexp " ") "toto tutu tata"is["toto";"tutu";"tata"].
val bounded_split : regexp -> string -> int -> string listbounded_split r s iis likesplit r sexcept that the result's length is less thani.