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
| Parameter | Type | Description |
|---|---|---|
| count | integer1–1000 | Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch. |
| edge | boolean | Restrict output to valid edge cases from the rare corners of the domain. |
| extreme | boolean | Return 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. |
| invalid | boolean | Return a deliberately invalid value that fails validation, for testing rejection paths. |
| maxRepetition | integer1–256 | How many times unbounded quantifiers (*, +, {n,}) may expand. Default 32. |
| pattern* | string | Regular expression (source form, no delimiters) to generate a matching string for, e.g. "[A-Z]{2}-\d{6}". |
| seed | integer | Integer seed for reproducible output: the same seed always yields the same record. |
Response fields
| Field | Type | Description |
|---|---|---|
| value | string | A random string matching the supplied pattern. |
| pattern | string | The source pattern the value was generated from. |
Other generic generators
Try it