Module Autocomplete.RegExpSource

Sourcetype t

A regular expression

include Jv.CONV with type t := t
val to_jv : t -> Jv.jv

to_jv reveals the JavaScript implementation.

val of_jv : Jv.jv -> t

of_jv hides the JavaScript implementation. Implementations usually do not guarantee type safety.

Sourcetype opts =
  1. | Indices
  2. | Global
  3. | Ignore
  4. | Multiline
  5. | DotAll
  6. | Unicode
  7. | Sticky
Sourceval create : ?opts:opts list -> string -> t

Create a regular expression from a string. Internally this uses new RegExp(s) which has it's own documentation. Note we pass noo flags at the moment.

Sourcetype result

The result of executing a regular expression search on a string

Sourceval get_full_string_match : result -> string

The matched text

Sourceval get_index : result -> int

0-based index of the match in the string

Sourceval get_indices : result -> (int * int) list

Each entry is a substring match of (start, end_)

Sourceval get_substring_matches : result -> string list

The matches for the parennthetical capture groups

Sourceval exec : t -> string -> result option

exec t s using the regular expression t to execute a search for a match in a specified string s.

Sourceval exec' : t -> Jstr.t -> result option

Same as exec only you can pass a Jstr.t instead.