arktypea
arktype3y ago
41 replies
TizzySaurus

Nesting ArkTypes within a regex

Is there a way to put ArkType types within a regex? As an example
const x = type("0<string<3");
const y = type("0<number<10");
const z = type("/x y/");
where for
z
something like
hi 3
would be valid, but not
hi 13
or
hello 5
-- i.e. to be valid, the value passed into
z
has to be a string of length 1 or 2, followed by a space, followed by a number 1-9 (inclusive))
Was this page helpful?