Skip to content

Regex Tester & Explorer

Test JavaScript regular expressions with live match highlighting, numbered and named groups, a token-by-token explanation and replace mode.

Regex Tester & Explorer

//g
Flags:
Test string
2 matches343 chars
Matches highlighted
Hello World! My email is test@example.com and my backup is hello.world@company.co.uk. Visit https://example.com or http://docs.example.org/path?q=test for more info. Phone: (555) 123-4567 or 555.987.6543 IP: 192.168.1.1 and 10.0.0.255 Date: 2026-02-11 Colors: #ff5733, #4a90d9, #333 <div class="container"> <p>Some HTML content</p> </div>
Pattern explanation
  1. [a-zA-Z0-9._%+\-] — character set
  2. + — one or more
  3. [a-zA-Z0-9.\-] — character set
  4. + — one or more
  5. \. — literal dot
  6. [a-zA-Z] — any letter
  7. {2,} — 2 or more times
Match details
Match 1 at index 25
test@example.com
Match 2 at index 59
hello.world@company.co.uk

Updated . Provided as is. Check the output before you rely on it in production.

How to use Regex Tester & Explorer

  1. 1

    Enter a pattern

    Type a regular expression without the surrounding slashes, or pick a common pattern such as Email, URL or IPv4.

  2. 2

    Set flags

    Toggle g, i, m, s and u. Keep g on to find every match.

  3. 3

    Read the matches

    Matches are highlighted in the test string, with capture groups listed for each match, and the pattern is explained in plain English.

  4. 4

    Try replacements

    Turn on Replace mode to preview substitutions with $1, $2 and $& references, then copy the matches.

Questions and answers

What is Regex Tester & Explorer?
A regular expression is a pattern for finding and replacing text, such as [0-9]{3} for three digits. This tester runs your pattern with the browser's JavaScript RegExp engine, highlights matches as you type, lists numbered and named groups, explains each token and previews replacements. It shares Regex Tester's engine.
Which regex flavor does it use?
Your browser's JavaScript RegExp engine, so results match Node.js and front-end code.
Is my text uploaded?
No. Matching runs entirely in your browser.
For AI agents: how to call this tool

Machine-readable contract, endpoints and examples. Humans can ignore this section.

Best Path For Builders

Browser workflow

Runs instantly in the browser with private local processing and copy/export-ready output.

Browser Workflow

This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.

/regex-explainer/

For automation planning, fetch the canonical contract at /api/tool/regex-explainer.json.