MCPcopy
hub / github.com/arktypeio/arktype / Regex

Interface Regex

ark/regex/regex.ts:19–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19export interface Regex<
20 out pattern extends string = string,
21 // @ts-ignore (override variance)
22 out ctx extends RegexContext = RegexContext
23> extends RegExp {
24 [inferred]: pattern
25 infer: pattern
26 inferCaptures: ctx["captures"] extends IndexedCaptures ? ctx["captures"] : []
27 inferNamedCaptures: ctx["names"] extends NamedCaptures ? ctx["names"] : {}
28 inferExecArray: RegexExecArray<
29 [pattern, ...this["inferCaptures"]],
30 this["inferNamedCaptures"],
31 this["flags"]
32 >
33
34 flags: ctx["flags"] extends Flags ? ctx["flags"] : ""
35
36 test(s: string): s is pattern
37
38 exec(s: string): this["inferExecArray"] | null
39 // allow extension of base RegExp with more accurate types
40 // since parameters are identical, this overload will never be hit
41 exec(s: string): never
42}
43
44export interface RegexParser {
45 <src extends string, flags extends Flags = "">(

Callers 12

getCompletionsFunction · 0.80
assertions.tsFile · 0.80
benchTemplate.tsFile · 0.80
patchC8.cjsFile · 0.80
isBalancedFunction · 0.80
tryParseDatePatternFunction · 0.80
stringIsIntegerLikeFunction · 0.80
parseJsDocLinkFunction · 0.80
parseEnclosedFunction · 0.80
applyReplacementsFunction · 0.80
shiki.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…