Skip to content
toolavix

Regex Tester (JavaScript)

Test regular expressions live, see every match and group, and preview replacements.

  • Free
  • No sign-up
  • 100% private

Runs in your browser — your files never leave your device.

What is a regular expression?

A regular expression (regex) is a pattern that describes text to find, validate or replace. This regex tester uses the JavaScript engine of your browser, so it matches how patterns behave in JavaScript and Node.js. Type a pattern, toggle flags and see matches highlighted instantly, with a table of positions, capture groups and named groups, plus a replace preview and ready-made patterns for e-mails, URLs, dates and more.

How to test a regular expression

  1. 1

    Type your pattern in the pattern field and choose the flags (g, i, m, s, u, y).

  2. 2

    Enter or paste the test string. Matches are highlighted as you type.

  3. 3

    Open the match table to see each match, its index and its capture or named groups.

  4. 4

    Fill in “Replace with” (for example $1 or $<name>) to preview the result, or load a ready-made pattern from the library.

Key features

Live highlighting

Every match is colored directly in the test string, with a counter and a table of indexes and groups.

Named and numbered groups

See each capture group and named group (?<name>…) for every match, including groups that did not participate.

Replace preview

Test String.replace with $1, $&, and $<name> references before you put the pattern in your code.

Common patterns library

Start from tested patterns for e-mail, URL, IPv4, ISO dates, hex colors, phone numbers, UUIDs and more.

Frequently asked questions

Which regex flavor does this tester use?

It uses the JavaScript (ECMAScript) regular expression engine of your browser, including lookbehind, named groups, Unicode property escapes and the flags g, i, m, s, u and y.

What do the regex flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at each line, s lets the dot match newlines, u enables full Unicode and y matches only at the current position (sticky).

How do I match an e-mail address with regex?

A practical pattern is [\w.+-]+@[\w-]+(?:\.[\w-]+)+. Perfect e-mail validation with a regex is not possible, so confirm addresses by sending a message.

What is catastrophic backtracking?

Some patterns with nested quantifiers, such as (a+)+$, can take exponential time on certain inputs and freeze the page. Avoid nested repeats on overlapping characters and keep patterns specific.

Is my text uploaded anywhere?

No. Matching runs entirely in your browser and your pattern and test string are only stored locally on your device.

More Developer tools

View all →