jon.recoil.org

Module Autocomplete.RegExpSource

Sourcetype t

A regular expression

include Jv.CONV with type t := Autocomplete.RegExp.t

to_jv reveals the JavaScript implementation.

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:Autocomplete.RegExp.opts list -> string -> Autocomplete.RegExp.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 : Autocomplete.RegExp.result -> string

The matched text

Sourceval get_index : Autocomplete.RegExp.result -> int

0-based index of the match in the string

Sourceval get_indices : Autocomplete.RegExp.result -> (int * int) list

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

Sourceval get_substring_matches : Autocomplete.RegExp.result -> string list

The matches for the parennthetical capture groups

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

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