Regex tester: test regular expressions in your browser

Type a pattern and some text to see every match and capture group highlighted as you go, then try a replacement. It all runs in your browser.

Flags
Working…

Capture groups
–
Match time
–
Highlighted test string

Shaded text is a match. Underlined text with a small number is a capture group.

Match table
# Match Position Groups

How this regex tester works

This regex tester runs your pattern against your text using the regular expression engine built into your browser. That is the JavaScript (ECMAScript) flavour, the same one used on web pages and in Node.js. The matching happens on your device.

As you type, the page builds a RegExp from the pattern and the flags you tick, runs it over the test string and redraws the results. If the pattern is invalid, you see the browser’s own error message instead.

Flags change how the pattern behaves. Tick g to find every match rather than only the first, i to ignore case, m so that ^ and $ match on every line or s so that the dot also matches line breaks. The u flag turns on full Unicode handling and y makes the match start exactly at the current position.

Here is what you get:

If you want a regex101 alternative that runs on your own device, this is built for that. The trade-off is that only the JavaScript engine is available, so features from PCRE, Python or .NET can behave differently. The notes under the tool list the main differences.

Take care with nested quantifiers such as (a+)+$. On some inputs they cause catastrophic backtracking, where the engine tries a huge number of routes and the tab can freeze. If that happens, reload the page and simplify the pattern. The time shown in the results helps you spot a slow pattern early.

Regex tester questions

How does JavaScript regex differ from PCRE?

This tester uses your browser’s JavaScript engine. It has no atomic groups, possessive quantifiers, recursion or conditionals, and it does not accept inline flags such as (?i) at the start of a pattern. Named groups are written (?<name>…) rather than (?P<name>…), and there are no \A or \Z anchors. The differences panel under the tool has the full list.

Why does my regex only find the first match?

In JavaScript a pattern without the g flag stops after the first match. Tick the g (global) box to find every match. The same applies in replace mode, where only the first match is replaced unless g is on.

How do I use capture groups in a replacement?

Put brackets around part of the pattern to make a group, then refer to it in the replacement as $1, $2 and so on. Named groups written (?<name>…) are used as $<name>. Use $& for the whole match and $$ for a literal dollar sign.

How do I share a regex I have tested?

Use the Copy link button. The pattern, flags, test string and replacement are stored in the part of the address after the # symbol, so anyone who opens the link sees the same setup. That part of an address stays in the browser and is not sent to the website when a page loads.

Is this a good regex101 alternative?

It covers the everyday jobs: live match and group highlighting, a match table, replace mode and shareable links. The matching runs on your device using the JavaScript engine, so there is no account or upload. If you need PCRE, Python or Go behaviour, confirm the result in that language too, because the engines differ.