Regex tester

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.

get/v1/regex

Request

  • Base URL: https://api.dharun.dev
  • URL: https://api.dharun.dev/v1/regex
  • Auth: none declared

Query parameters

patternstring required

The regular expression, without slashes. Up to 4096 bytes.

textstring

The text to test it on (or POST it).

flavor'js' | 're2'

js (default): JavaScript syntax, with lookaround and backreferences. re2: Go's syntax, linear time.

flagsstring

Any of i (ignore case), m (^ and $ at line breaks), s (. matches line breaks). Every match is always listed, so g is not needed.

replacestring

Replace every match with this: $1, $<name>, $& and $$ in js; ${1}, ${name} and $$ in re2.

limitinteger

Matches listed, 1 to 1000. Default 100; count goes on to the end of the text.

Response

Success

dataunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.