Test a regular expression
An invalid pattern answers 422 with code invalid_pattern and the engine's message; a JavaScript pattern that runs out of time answers 422 with code timeout. A group that took no part in a match has a null text, which is different from an empty one.
Request
- Base URL: https://api.dharun.dev
- URL: https://api.dharun.dev/v1/regex
- Auth: none declared
Query parameters
The regular expression, without slashes. Up to 4096 bytes.
The text to test it on (or POST it).
js (default): JavaScript syntax, with lookaround and backreferences. re2: Go's syntax, linear time.
Any of i (ignore case), m (^ and $ at line breaks), s (. matches line breaks). Every match is always listed, so g is not needed.
Replace every match with this: $1, $<name>, $& and $$ in js; ${1}, ${name} and $$ in re2.
Matches listed, 1 to 1000. Default 100; count goes on to the end of the text.
Response
Success
Changes
No recorded changes to this operation across all 1 revision of this API.