Online Regex Tester — Test Patterns Live, Free

Regex Tester — Debug Patterns Live

Type a regular expression and watch it match your sample text in real time — with highlighted matches, capture-group breakdowns, flag toggles, and a substitution tester. JavaScript regex, running entirely in your browser.

Pattern

Enter the pattern body only — no surrounding slashes. Toggle flags below, or pick a starter from the cheat sheet.

Test text

Matches update live as you type. Your text is escaped before display, so HTML in it is shown as text — never rendered.

0matches 0capture groups
Enter a pattern above to begin.

Groups appear here once your pattern matches.

Substitution tester

Try a replacement string against the same pattern and text. Use $1, $2 … for capture groups, $& for the whole match.

Replacement result appears here.
100% private

Patterns and test text are evaluated locally with JavaScript. Nothing you type ever leaves your browser.

No signup

Test as many patterns as you like, instantly — no account, no email, no limits.

Free forever

Live highlighting, capture groups, substitution, and the cheat sheet — all free, always.

How to use

  1. 1
    Enter your pattern

    Type the regex body without surrounding slashes — for example (\w+)@(\w+). Toggle flags like g, i, and m, or load a starter from the cheat sheet.

  2. 2
    Paste test text

    Drop in the string you want to test against. Every match lights up in green the moment you type, with a live match count.

  3. 3
    Inspect groups and substitutions

    Open the capture-group table to see what each (…) group grabbed, then try a replacement like [$1] to preview substitutions.

Features

Live match highlighting

Matches re-compute on every keystroke in the pattern, flags, or test text — no Run button, no waiting.

Capture-group table

See every match with its index, the full matched text, and each group’s value side by side. Unmatched groups are labeled clearly.

Flag toggles

One-click toggles for g, i, m, s, u, and y — with plain-English labels so you always know what each flag does.

Substitution preview

Test replacement strings with $1, $2, and $& placeholders against your live pattern before using them in code.

Common-patterns cheat sheet

One click loads a tested pattern for email, URL, US phone, MM/DD/YYYY date, IPv4, or hex color — then tweak it freely.

Clear error messages

Invalid patterns show the browser’s exact error (like “Unterminated group”) instead of failing silently, so you know what to fix.

Frequently asked questions

Do I include the forward slashes around my pattern?
No — enter the pattern body only. In code you would write /(\w+)@(\w+)/gi, but here you type (\w+)@(\w+) and turn on the g and i flags with the toggle buttons.
What do the flags mean?
g (global) finds every match instead of stopping at the first. i ignores case. m makes ^ and $ match line starts and ends in multiline text. s lets . match newlines too. u enables full Unicode matching. y (sticky) only matches starting exactly at the current position.
Why does my pattern show an error?
The pattern failed to compile as JavaScript regex. Common causes: an unclosed parenthesis or bracket like “([“, a stray backslash at the end, or an invalid group name. The error box shows the exact reason — fix that spot and the tester resumes live.
What do $1, $2, and $& mean in the substitution box?
$1 is the text captured by the first (…) group, $2 the second, and so on. $& is the entire match. So with the pattern (\w+)@(\w+) and the replacement [$1]@$2, “user@mail” becomes [user]@mail.
Which regex flavor is this?
JavaScript’s RegExp engine — the same one used in browsers and Node.js. Most everyday patterns work identically in Python, PHP, and other flavors, but advanced features like lookbehind limits and named groups can differ.
Why doesn’t ^…$ match anything in my multiline text?
Without the m flag, ^ and $ only match the very start and end of the whole text. Turn on the m (multiline) flag and they will match at each line boundary.
Is my test data private?
Yes. Matching runs entirely in your browser with JavaScript — your pattern and test text are never uploaded or logged anywhere.
Is this regex tester free?
Yes — free and unlimited with no signup. It runs locally in your page, so there is nothing to charge for.
Scroll to Top