>_
.*

Regex Tester

Test JavaScript regular expressions with live match highlighting, capture groups, named groups and replace preview.

Runs locally — your input never leaves this page.

/ /g
Flags
Groups
Replace result
 

How to use

  1. Type a pattern without the surrounding slashes, e.g. \d{3}-\d{4}.
  2. Toggle flags: g global, i ignore case, m multiline, s dotAll, u unicode.
  3. Matches are highlighted in the test text, and each match’s index and capture groups are listed below.
  4. Fill in the replacement field to preview String.replace() output; use $1 or $<name> for groups.

FAQ

Which regex flavor is used?

Your browser’s JavaScript (ECMAScript) engine, so results match exactly what new RegExp() does in your code — including lookbehind and named groups.

Why does my pattern only find one match?

Without the g flag, JavaScript stops after the first match. Enable g to find all of them.

Report a bug or suggest a feature →