GT GetToolsFree
Free · No sign-up · Runs in your browser

Regex Tester

Test a JavaScript regular expression against your own text and see every match highlighted, with capture groups broken out.

Ad space — 728×90 banner
Matches

How to use the Regex Tester

  1. Type a pattern (without the surrounding slashes).
  2. Toggle flags: g (global), i (case-insensitive), m (multiline), s (dot matches newline).
  3. Paste your test text — matches and any capture groups appear below as you type.

How it works

This tests patterns using JavaScript's native RegExp engine — the same one your browser's console uses — so results match exactly what you'd get in JS code. For example, the pattern \d+ with the g flag against "Room 42, Floor 7" finds two matches: "42" and "7". If your pattern has capture groups — parentheses like (\d{3})-(\d{4}) — each match's captured pieces are listed separately underneath it.

Frequently asked questions

Does this test PCRE, Python, or another regex flavor?

No — only JavaScript's regex syntax. Most common patterns work the same across languages, but some features (like Python's named groups syntax) differ.

Is my text sent anywhere?

No — matching runs entirely in your browser using JavaScript's built-in RegExp, nothing is uploaded.

Why did my browser freeze on a complex pattern?

Certain regex patterns (heavy nested quantifiers, like (a+)+b against a long non-matching string) can cause "catastrophic backtracking," which is slow in any regex engine, not specific to this tool. If a pattern hangs, refresh the page and simplify it.