Regex Tester

Test regular expressions against sample text in the browser. See all matches, indices, and groups. Invalid regex patterns show a clear error.

Regex Tester tool

How to use

  1. Enter pattern and flags

    Type your regular expression in the pattern field. Add flags (e.g. g for global, i for case-insensitive) in the flags field.

  2. Enter test text

    Paste or type the string you want to test against. The tool will list all matches.

  3. Review matches

    Each match shows the matched text, index, and any capture groups. Invalid regex syntax is reported as an error.

Examples

Frequently asked questions

Which regex flavor is used?
The tool uses JavaScript's native RegExp, so it follows ECMAScript regex rules. Lookahead, capture groups, and standard character classes are supported.
Why does my pattern show an error?
Invalid syntax (e.g. unescaped brackets, invalid quantifiers) causes the engine to throw. Check your backslashes and special characters and try again.

You might find these useful too.