QA
Regex Tester and Debugger
Try a pattern and flags against sample text, then inspect every match and capture with its character range.
How this tool works
JavaScript regular expressions can use named groups, lookarounds, Unicode flags, and zero-length matches. Seeing match boundaries helps distinguish an unexpected capture from an unexpected search position.
A passing sample does not prove a pattern safe or correct for every input. Catastrophic backtracking remains possible with some expressions.
Examples
- Find issue IDs in a synthetic log line.
- Compare numbered and named captures.
- Check an optional group and a zero-length boundary.
Common use cases
Worked synthetic example
Valid example
Pattern: (?<id>BUG-\d+) | Text: fixed BUG-42
Expected: Match BUG-42; id = BUG-42. The named capture identifies the issue token within the line.
Failure or warning to recognize
Invalid/failure example
Pattern [abc against sample abc (unterminated character class)
Expected: An unterminated [ character class reports a regular-expression syntax error; no matches are computed.