Generator · Generic data

String matching a regular expression

Endpoint GET /v1/custom-regex

What it covers

Returns a random string that matches the supplied regular expression (`pattern`) — for seeding data whose format the catalog does not model, such as in-house serial numbers or SKUs. `maxRepetition` caps how many times unbounded quantifiers (`*`, `+`, `{n,}`) expand. Back-references, look-around assertions, and patterns with an over-large worst-case expansion are rejected. This endpoint requires the Pro plan or above. Percent-encode reserved characters in `pattern` — most importantly `+` must be sent as `%2B`, since a literal `+` in a query string decodes to a space.

Parameters

ParameterTypeDescription
countinteger1–1000Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch.
edgebooleanRestrict output to valid edge cases from the rare corners of the domain.
extremebooleanReturn a correct value wrapped in a hostile encoding (untrimmed whitespace, invisible/zero-width characters, BOM, or bidi/combining marks). Homoglyphs are excluded so the value stays machine-parseable; it still validates after normalisation.
invalidbooleanReturn a deliberately invalid value that fails validation, for testing rejection paths.
maxRepetitioninteger1–256How many times unbounded quantifiers (*, +, {n,}) may expand. Default 32.
pattern*stringRegular expression (source form, no delimiters) to generate a matching string for, e.g. "[A-Z]{2}-\d{6}".
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringA random string matching the supplied pattern.
patternstringThe source pattern the value was generated from.

Other generic generators

Try it

Generate a live example below — every response is valid by format and entirely synthetic.