Home > @antv/dw-random > BasicRandom > randexp
Generate a string which match regexp
Signature:
randexp(source: string | RegExp, flag?: string): string;
Parameter | Type | Description |
---|---|---|
source | string | RegExp |
regexp or source of regexp |
flag | string |
flag(only support i ) |
Returns:
string
new Random().randexp('\\d{4}-\\d{8}');