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 a free account (any tier); it is the one feature not available to anonymous callers, for an audit trail of caller-supplied patterns. 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–10000 | Number of records to return, 1–10000. Omitted returns a single record; set it for a batch. Costs 1 token plus a tenth per record. |
| 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
Auto-increment integer sequenceCompany name from one or more countriesDraw a member from a weighted enumerationDraw an object from a weighted list of candidatesEmail address from one or more countriesLorem ipsum textMongoDB ObjectIdNano IDPayment card number with expiry and security codePerson nameProduct or service offeringULIDUUIDVehicle registration plate from one or more countries
Try it