Skip to content

Regex Tester

Test a regular expression live, with every match and capture group shown.

Quick Tool Overview

The Regex Tester runs a pattern against your own text on every keystroke, highlighting matches in place and listing every capture group — with a guard against the catastrophic backtracking that can otherwise lock the page.

What it does
Tests a JavaScript regular expression live
You give it
A pattern, flags and some test text
You get back
Highlighted matches, groups and a replace preview
Best for
Writing and debugging a pattern before it ships
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the Regex Tester

Type a pattern and it runs against your text on every keystroke, with matches highlighted in place so you can see exactly what is and is not being caught. Every match is also listed with its position and each of its capture groups.

Named groups are shown by name, which matters once a pattern has more than two of them and counting brackets stops being reliable. There is a replace mode that previews the result with $1 and named references working as they would in code, and a catastrophic-backtracking guard that stops a runaway pattern from locking the page — which is a real risk with nested quantifiers and the reason some regular expressions take down production servers.

Key features of the Regex Tester

Matches highlighted in place

Seeing what is caught inside the real text is far more useful than a list of strings out of context.

Named groups by name

Once a pattern has three groups, counting brackets stops being reliable — so named groups are listed by their names.

Replace preview

$1 and named references behave exactly as they will in your code, so the replacement is checked rather than assumed.

Backtracking guard

A pattern like (a+)+b can take exponential time on near-matching input. The tester stops rather than freezing — which is also a real production risk worth knowing about.

Flags explained

What g, i, m, s and u each change, where you are turning them on.

How to use the Regex Tester

  1. 1

    Write your pattern

    Without the delimiters; the flags have their own controls.

  2. 2

    Paste your test text

    Matches are highlighted in place as you type.

  3. 3

    Check the groups

    Every match lists its position and each capture group, named or numbered.

  4. 4

    Try a replacement

    Preview the result with $1 and named references working as in code.

Frequently asked questions

JavaScript, since it runs in your browser. It is close to PCRE for everyday patterns, but lookbehind, named groups and Unicode property escapes differ in support — and JavaScript has no possessive quantifiers or atomic groups.

Reviews of the Regex Tester

What people who use the Regex Tester think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Regex Tester. It takes half a minute and no account.

Write the first review

More developer tools