API Reference / @evolu/common / Type / regex

Variable: regex()

const regex: <Name>(name, pattern) => BrandFactory<Name, string, RegexError<Name>>;

Defined in: packages/common/src/Type.ts:1192

String matching a regular expression.

Example

const Alphanumeric = regex("Alphanumeric", /^[a-z0-9]+$/i)(String);

Type Parameters

Type Parameter
Name extends TypeName

Parameters

ParameterType
nameName
patternRegExp

Returns

BrandFactory<Name, string, RegexError<Name>>

Was this page helpful?