Developer tool

Regex Tester

Test regular expressions, inspect capture groups, and highlight every match.

Practical guide

How to use Regex Tester

Regex Tester provides a fast place to build and inspect JavaScript regular expressions. Matches are highlighted in context and listed with indexes and capture groups, which makes subtle pattern behavior easier to understand.

Step by step

  1. Enter a pattern without surrounding slash delimiters.
  2. Choose JavaScript flags such as g, i, m, s, u, or y and add representative test text.
  3. Run the test and inspect highlighted matches, indexes, and captured groups.

Example

InputPattern: \btool\w* · Text: tools, toolkit, task
ResultMatches: tools; toolkit

How it works

The pattern is compiled with the browser's JavaScript RegExp engine. Global matching is enabled for the result list so every occurrence can be shown, while other requested flags are preserved.

Important limitations

  • JavaScript syntax and features can differ from PCRE, Python, Java, or .NET regex engines.
  • A poorly designed expression can be slow on large or adversarial text.

Frequently asked questions

Should I include /pattern/ delimiters?

No. Enter only the pattern and place flags in the separate flags field.

Why does the pattern work elsewhere but not here?

The other environment may use a different regex engine or escaping convention.