Regex Tester

Write a regular expression and watch matches and capture groups light up in your test text as you type. Toggle flags, try replacements and inspect every match, privately in your browser.

//gm

Matches

Matches are highlighted here as you type.

Tested on your device. Your pattern and text are never uploaded.

How to Use Regex Tester Online

This regex tester runs your pattern with your browser's own JavaScript regular expression engine, so results match exactly what your code will do. Matches are highlighted in the test string as you type, and each capture group gets its own colour, including nested and named groups. Toggle the g, i, m, s, u and y flags with one click, see every match with its index and group values in a table, and switch on Replace to preview the result of $1 and $<name> substitutions. Patterns run in a separate background worker with a time limit, so a runaway expression with catastrophic backtracking is stopped instead of freezing your tab. Nothing is uploaded: your patterns and test data, including logs and customer records, stay entirely on your device.

  1. 1

    Type your regular expression into the pattern box, without the surrounding slashes.

  2. 2

    Toggle the flags you need, such as g for all matches, i to ignore case or m for multiline.

  3. 3

    Paste your test text to see matches and capture groups highlighted, then check the details table or try a replacement.

Why use this Regex Tester

Live highlighting

Matches and each capture group are coloured in your text as you type.

Every flag

Toggle g, i, m, s, u and y, with named groups and lookbehind supported.

Replace preview

Test $1, $& and $<name> replacements before using them in code.

Freeze-proof

Slow patterns are stopped after 1.5 seconds instead of locking up the page.

Popular uses for the Regex Tester

Validate emails, phones and URLs

Test validation patterns against real examples before shipping.

Extract data from logs

Build capture groups that pull IDs, dates and errors out of log lines.

Find and replace in bulk

Preview $1 and named-group replacements before running them in your editor.

Learn regular expressions

See instantly how each flag and group changes what matches.

Also known as: regex checker, regular expression tester, regex debugger, regex validator, JavaScript regex tester and regex match online.

People also search for

  • test regular expression online
  • javascript regex tester with highlighting
  • regex for email validation test
  • debug regex match groups
  • regex playground online free

Free developer tools that never see your code

Encode Base64, minify CSS, HTML and JavaScript, and debug regular expressions with client-side developer tools. Your code, tokens and test data stay in your browser tab, results appear instantly as you type, and there's nothing to install or sign up for.

Frequently asked questions

Which regex flavour does this tester use?

JavaScript (ECMAScript), using your browser's built-in engine, so results match JavaScript and TypeScript code exactly. Most everyday syntax is shared with PCRE, Python and Java.

What do the g, i and m flags do?

g (global) finds every match instead of only the first, i makes matching case-insensitive, and m (multiline) makes ^ and $ match at the start and end of each line rather than the whole text.

Related tools