Quickjs.RegExpval compile :
flags:string ->
string ->
(t,
[ `Unexpected_end
| `Malformed_unicode_char
| `Invalid_escape_sequence
| `Nothing_to_repeat
| `Unknown of string ]
* string)
resultConstructs a RegExp.t from a string describing a regex and their flags
val lastIndex : t -> intreturns the index where the next match will start its search
val setLastIndex : t -> int -> unitsets the index at which the next match (RegExp.exec or RegExp.test) will start its search from
val flags : t -> stringreturns the enabled flags as a string
val global : t -> boolreturns a bool indicating whether the global flag (g) is set
val ignorecase : t -> boolreturns a bool indicating whether the ignorecase (i) flag is set
val multiline : t -> boolreturns a bool indicating whether the multiline (m) flag is set
val dotall : t -> boolreturns a bool indicating whether the dot all (s) flag is set
val sticky : t -> boolreturns a bool indicating whether the sticky (y) flag is set
val unicode : t -> boolreturns a bool indicating whether the unicode (u ) flag is set
val source : t -> stringreturns the regexp pattern as a string
val test : t -> string -> boolchecks whether the given RegExp.t will match (or not match) a given string
val captures : result -> string arrayan array of the match and captures
val input : result -> stringthe original input string
val index : result -> intsets the index at which the next match (RegExp.exec or RegExp.test) will start its search from