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:1338
String matching a regular expression.
Example
const Alphanumeric = regex("Alphanumeric", /^[a-z0-9]+$/i)(String);
Type Parameters
| Type Parameter |
|---|
Name extends TypeName |
Parameters
| Parameter | Type |
|---|---|
name | Name |
pattern | RegExp |
Returns
BrandFactory<Name, string, RegexError<Name>>