Regex Tester

Test JavaScript regular expressions with live match highlighting, capture groups, find-and-replace and a plain-English explanation of every part of your pattern.

Runs in your browser Free, no sign-up Desktop & mobile
//g
Matches highlighted

Matches

No matches yet.

Explanation

  1. Type a pattern to see what each part does.
Regex cheat sheet
.Any character except line breaks
\d \w \sDigit, word character, whitespace
\D \W \SNot a digit / word char / whitespace
[abc] [^abc]Any of a, b, c / anything except them
[a-z0-9]Character range
^ $Start / end of string (or line with m)
\bWord boundary
* + ?0 or more, 1 or more, optional
{3} {2,5}Exactly 3 / between 2 and 5 times
*? +?Lazy (as few as possible)
(abc)Capturing group
(?<name>abc)Named group
(?:abc)Non-capturing group
a|ba or b
(?=x) (?!x)Followed by / not followed by x
(?<=x) (?<!x)Preceded by / not preceded by x
\1 \k<name>Back-reference to a group
\p{L}Any Unicode letter (needs u flag)

What is Regex Tester?

Regex Tester lets you write and debug regular expressions with instant feedback. As you type, every match in your test text is highlighted, and a match list shows each result with its position and capture groups — including named groups. Switch on replace mode to preview a find-and-replace with $1, $<name> and other substitutions.

Not sure what a pattern does? The explainer breaks your regex into its parts — character classes, quantifiers, groups, anchors and lookarounds — and describes each one in plain English. Patterns run in a separate worker with a time limit, so a runaway expression can’t freeze your browser.

How to use Regex Tester

Get it done in 4 simple steps — no installation or account needed.

  1. Type your regular expression in the pattern box (without the surrounding slashes) and choose flags.
  2. Paste the text you want to test — matches are highlighted instantly.
  3. Check the match list for positions and capture groups, and the explanation for what each part does.
  4. Turn on Replace to preview a substitution, then copy the pattern or the result.

Limitations & supported browsers

Works in the latest Chrome, Edge, Firefox, Safari (Mac, iPhone and iPad) and Samsung Internet. Because processing happens on your device, speed and maximum file size depend on your device’s memory.

  • Uses the JavaScript (ECMAScript) regex engine. PCRE-only features like possessive quantifiers (a++), atomic groups and recursion aren’t supported.
  • Patterns that take longer than 1 second are stopped to protect your browser.
  • The explanation covers common syntax; very complex patterns may be summarized rather than fully explained.

Who needs Regex Tester?

From students to professionals, here’s who gets the most out of Regex Tester — and why.

Developers

Build and debug validation, parsing and search patterns for JavaScript and TypeScript.

Data & log analysts

Extract IDs, emails, IPs and dates from messy text and logs.

QA & SEO specialists

Write patterns for test filters, redirects and analytics segments.

Learners

Understand how a regex works piece by piece.

Is Regex Tester safe to use?

Yes. Regex Tester runs entirely in your web browser using JavaScript. Your files and data are processed on your own device and are never uploaded to AppsOcean or any third-party server. There’s nothing to install, no account to create, and it’s completely free.Read our privacy policy.

Regex Tester — frequently asked questions

Why does my pattern only find the first match?

Without the g (global) flag, JavaScript stops after the first match. Turn on “g” to find all matches.

What is catastrophic backtracking?

Some patterns, like (a+)+$, take exponentially longer on certain inputs and can hang a page. This tester runs patterns in a worker and stops them after a short time limit.

Which regex flavor is used?

JavaScript (ECMAScript) regular expressions, exactly as they behave in modern browsers and Node.js — including named groups, lookbehind and Unicode property escapes.

Last updated

Esc
↑↓ navigate Enter open