Skip to content
MySafeToolbox

Regex Tester

Free regex tester with live match highlighting, capture and named groups, replace preview and a library of common patterns. Runs safely in your browser.

  • No upload — 100% private
  • Instant, on your device
  • Free, no sign-up
  • Works offline once loaded

How it works

How to use Regex Tester

  1. Type a pattern or pick one from Common patterns.

  2. Toggle flags such as g, i, m, s, u and y.

  3. Paste test text — every match is highlighted as you type, with groups listed alongside.

  4. Switch to Replace to preview substitutions using $1, $<name> or $&.

Why use it

Why use our Regex Tester tool

Live highlighting

Matches are highlighted directly in the text, alternating colours for adjacent matches.

Groups and named groups

Every match lists its index range and capture groups, labelled with their names.

Replace preview

See the full result of String.replace with backreferences before you use it in code.

Pattern library

Ready-made patterns for email, URL, phone, IPv4, dates, times, hex colours, UUIDs and more.

Freeze-proof

Patterns run in a Web Worker with a time limit, so catastrophic backtracking can't hang the page.

FAQ

Frequently asked questions

Which regex flavour does this tester use?

It uses your browser's JavaScript (ECMAScript) engine — the same behaviour as RegExp in Node.js, Deno and front-end code, including lookbehind and named groups.

What do the g, i, m, s, u and y flags do?

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

What is catastrophic backtracking?

Patterns like (a+)+ can take exponential time on certain inputs. This tester stops any pattern that runs longer than 1.5 seconds and tells you, instead of freezing.

How do I reference groups in a replacement?

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

Why does my pattern only find one match?

Without the g (global) flag, JavaScript returns only the first match. Turn on g to find every occurrence.