MCPcopy Create free account
hub / github.com/arktypeio/arktype / Regex

Interface Regex

ark/regex/regex.ts:74–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74export interface Regex<
75 out pattern extends string = string,
76 // @ts-ignore (override variance)
77 out ctx extends RegexContext = RegexContext
78> extends RegExp {
79 [inferred]: pattern
80 infer: pattern
81 inferCaptures: ctx["captures"] extends IndexedCaptures ? ctx["captures"] : []
82 inferNamedCaptures: ctx["names"] extends NamedCaptures ? ctx["names"] : {}
83 inferExecArray: RegexExecArray<
84 [pattern, ...this["inferCaptures"]],
85 this["inferNamedCaptures"],
86 this["flags"]
87 >
88
89 flags: ctx["flags"] extends Flags ? ctx["flags"] : ""
90
91 test(s: string): s is pattern
92
93 exec(s: string): this["inferExecArray"] | null
94 // allow extension of base RegExp with more accurate types
95 // since parameters are identical, this overload will never be hit
96 exec(s: string): never
97}
98
99export interface RegexParser {
100 <src extends string, flags extends string = "">(

Callers 15

compileMethod · 0.85
InlineErrors.ktFile · 0.85
ErrorLensClass · 0.85
LookbehindRewriterClass · 0.85
resolveReferencesMethod · 0.85
parseQuantifierMethod · 0.85
parseEscapeMethod · 0.85
skipClassMethod · 0.85
parseGroupMethod · 0.85
compileMethod · 0.85
requiredLiteralsFunction · 0.85
RegexSourceClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected