this repo has no description
1type t
2(** A regular expression *)
3
4include Jv.CONV with type t := t
5
6type opts = Indices | Global | Ignore | Multiline | DotAll | Unicode | Sticky
7
8val create : ?opts:opts list -> string -> t
9(** Create a regular expression from a string. Internally this uses
10 [new RegExp(s)] which
11 {{:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp}
12 has it's own documentation}. Note we pass noo flags at the moment. *)
13
14type result
15(** The result of executing a regular expression search on a string *)
16
17val get_full_string_match : result -> string
18(** The matched text *)
19
20val get_index : result -> int
21(** 0-based index of the match in the string *)
22
23val get_indices : result -> (int * int) list
24(** Each entry is a substring match of [(start, end_)] *)
25
26val get_substring_matches : result -> string list
27(** The matches for the parennthetical capture groups *)
28
29val exec : t -> string -> result option
30(** [exec t s] using the regular expression [t] to execute a search for a match
31 in a specified string [s]. *)
32
33val exec' : t -> Jstr.t -> result option
34(** Same as {!exec} only you can pass a {!Jstr.t} instead. *)