API reference › @evolu/common › Type › regex
const regex: <Name>(
name: Name,
pattern: RegExp,
) => BrandFactory<Name, string, RegexError<Name>>;
Defined in: packages/common/src/Type.ts:1497
String matching a regular expression.
Example
const Alphanumeric = regex("Alphanumeric", /^[a-z0-9]+$/i)(String);