-
Notifications
You must be signed in to change notification settings - Fork 483
Expand file tree
/
Copy pathStdlib_RegExp.res
More file actions
31 lines (25 loc) · 1.14 KB
/
Stdlib_RegExp.res
File metadata and controls
31 lines (25 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@notUndefined
type t
module Result = {
type t = array<option<string>>
@get_index external fullMatch: (t, @as(0) _) => string = ""
@send external matches: (t, @as(1) _) => array<option<string>> = "slice"
@send external captures: (t, @as(1) _) => array<option<string>> = "slice"
@get external index: t => int = "index"
@get external input: t => string = "input"
}
@new external fromString: (string, ~flags: string=?) => t = "RegExp"
@new external fromStringWithFlags: (string, ~flags: string) => t = "RegExp"
external escape: string => string = "RegExp.escape"
@send external test: (t, string) => bool = "test"
@return(nullable) @send external exec: (t, string) => option<Result.t> = "exec"
@get external lastIndex: t => int = "lastIndex"
@set external setLastIndex: (t, int) => unit = "lastIndex"
@get external ignoreCase: t => bool = "ignoreCase"
@get external global: t => bool = "global"
@get external multiline: t => bool = "multiline"
@get external source: t => string = "source"
@get external sticky: t => bool = "sticky"
@get external unicode: t => bool = "unicode"
@get external flags: t => string = "flags"
external ignore: t => unit = "%ignore"