Skip to content
SolveKit

Test regular expressions.

Write a pattern, paste some text and see every match, group and replacement update as you type.

Updated · Free · Runs in your browser — nothing is uploaded

Regular expression

//gi

Test text

Contact ada@example.com or grace.hopper@navy.mil. Invalid: alan@ and @turing.org

Turn on to preview a find-and-replace.

At a glance

Last updated

  • The Regex Tester runs JavaScript regular expressions with live highlighting, capture and named groups, all six flags and a replace preview.
  • Patterns run in a worker with a 1.5-second limit to stop catastrophic backtracking.
  • It runs entirely in the browser; nothing you paste is sent to a server.

How it works

Matches are found with your browser's own JavaScript engine, so results are exactly what JavaScript, TypeScript and Node.js will do. Each match shows its position and capture groups, including named groups.

The pattern runs in a background worker with a time limit. A pattern that backtracks catastrophically — for example (a+)+$ against a long string — is stopped instead of freezing the page, and you're told why.

Flags

g finds every match, i ignores case, m makes ^ and $ work per line, s lets . match line breaks, u enables full Unicode and \p{…} classes, and y matches only at the current position.

Frequently asked questions

Which regex flavour does this use?

JavaScript (ECMAScript), as implemented by your browser. Most syntax is shared with PCRE, Python and Java, but some features differ — for example, JavaScript has no possessive quantifiers or atomic groups.

Why was my pattern stopped?

It took longer than 1.5 seconds, which almost always means catastrophic backtracking from nested quantifiers like (a+)+ or (.*)*. Make the inner part more specific.

How do I refer to groups in the replacement?

Use $1, $2… for numbered groups, $<name> for named groups and $& for the whole match.