Regex Tester

Write a regular expression and see 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.

Testing a regular expression

Your pattern runs on your browser's own JavaScript regex engine, so results match exactly what your code will do. Matches are highlighted in the test text as you type, and every capture group – nested and named ones included – gets its own colour. Toggle the g, i, m, s, u and y flags with a click, see each match with its index and group values in a table, and turn on Replace to preview $1 and $<name> substitutions. Patterns run in a background worker with a time limit, so a runaway expression with catastrophic backtracking is stopped rather than freezing the tab. Nothing is uploaded – your patterns and test data, logs and customer records included, stay on your device.

  1. 1

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

  2. 2

    Switch on the flags you need – g for every match, i to ignore case, m for multiline.

  3. 3

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

What makes this Regex Tester handy

Live highlighting

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

All the flags

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

Replace preview

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

Won't freeze

Slow patterns are stopped after 1.5 seconds rather than locking up the page.

What people use the Regex Tester for

Check emails, phone numbers and URLs

Test validation patterns against real examples before you ship.

Pull data out of logs

Build capture groups that extract IDs, dates and errors from log lines.

Bulk find and replace

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

Learn regex

See straight away how each flag and group changes the matches.

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

Related searches

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

Developer tools that keep your code to yourself

Encode Base64, minify CSS, HTML and JavaScript, and debug regular expressions without your code leaving the tab. Tokens and test data stay in your browser, results update as you type, and there's nothing to install or sign up for.

Questions & answers

Which regex flavour is this?

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 mean?

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

You might also need