Regex Tester
The /regex endpoint tests a regular expression pattern against a text string and returns structured match results including capture groups and named groups.
Use Cases
Validate regex patterns during development, extract structured data from raw text, debug complex capture groups, or build regex-powered search previews without running server-side code.
curl -X GET \ "https://api.moxon.dev/v4/regex"Send the request to see the response here.
patternstringrequiredThe regular expression pattern to test (max 200 characters).
textstringrequiredThe text to test the pattern against (max 1000 characters).
flagsstringoptionalRegex flags to apply. Accepted:
i,m,s,u. Thegflag is always applied.
validbooleantrueif the pattern is a valid regexpatternstringThe pattern as provided
flagsstringThe effective flags used (always includes
g)countnumberTotal number of matches found
matchesobject[]Array of match objects
matches[].matchstringThe full matched string
matches[].indexnumberStart index of the match in the text
matches[].groupsstring[]Array of numbered capture group values (empty string if unmatched)
matches[].namedGroupsobjectKey-value map of named capture groups (
(?<name>...))
- 400
Please provide a pattern (?pattern=...)Thepatternparameter is missing - 400
Please provide a text (?text=...)Thetextparameter is missing - 400
Pattern must be at most 200 charactersThepatternexceeds the maximum length - 400
Text must be at most 1000 charactersThetextexceeds the maximum length - 400
Invalid flag: {flag}. Accepted flags: g, i, m, s, uOne or more flags are not supported - 400
Invalid regular expressionThe pattern is not a valid regular expression
Last updated on May 11, 2026