TizzySaurus
TizzySaurus
Aarktype
Created by TizzySaurus on 5/21/2023 in #questions
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/");
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))
42 replies