Regex Tester

Write a pattern, paste your text, and see every match, group and position highlighted instantly.

About this tool

Regular expressions are powerful and easy to get subtly wrong. This tester runs your pattern against sample text with JavaScript’s own regex engine — so what works here works in your browser-side code — and shows every match with its position, capture groups and a highlighted preview of the input.

How to use it

  1. Type your pattern (without the surrounding slashes) and tick the flags you need: g global, i case-insensitive, m multiline, s dot-all.
  2. Paste or type the test text and click Test expression.
  3. Read the highlighted preview, then the per-match table with groups ($1, $2, …).

Good to know

  • Invalid patterns produce a precise error from the engine instead of a silent empty result.
  • Zero-length matches are stepped over safely so the tool never hangs.
  • The test runs on JavaScript (ECMAScript) regex syntax — mostly compatible with other languages, but lookbehind and unicode properties vary between engines.