Regex Tester

Test a regular expression against sample text with highlighted matches, indexes, and capture groups — live as you type.

Runs in your browser — nothing is uploaded

0Matches

Related tools

How to use the Regex Tester

  1. Type your regular expression into the Pattern box — do not include the surrounding slashes.
  2. Tick the flags you need: g for all matches instead of just the first, i for case-insensitive matching, and m, s, or u as required.
  3. Edit the test text and watch the highlighted preview, match count, and match list update live.
  4. Check each match's index and any capture groups in the Matches list, and fix any error shown under the pattern.

Frequently asked questions

Is my text uploaded to a server?

No. Patterns are compiled and run entirely in your browser using JavaScript's RegExp. Your text is never uploaded, stored, or sent anywhere.

Do I need to include slashes around the pattern?

No. Type the pattern only, without the /…/ slashes you would use in JavaScript code. Choose the flags using the checkboxes instead of letters after a closing slash.

Why do I only see one match?

Without the g (global) flag, a search stops at the first match — that mirrors how RegExp behaves in JavaScript. Tick the g flag to find every match in the text.

What are capture groups?

Parts of the pattern wrapped in parentheses are capture groups. When a match has groups, this tool lists each group's captured text under the match so you can check exactly what was captured.

Why is there a limit of 1,000 matches?

Patterns that can match empty strings or very short text could otherwise produce an unbounded number of matches and freeze the page. Matches are capped at 1,000, zero-width matches safely advance the search position, and the tool notes when the cap is reached.