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.
- Free, no sign-up
- Runs in your browser
- Updated Nov 2026
Shaded text is a match. Underlined text with a small number is a capture group.
| # | Match | Position | Groups |
|---|
| Token | Meaning |
|---|---|
. | Any character except a line break |
\d | A digit |
\D | Not a digit |
\w | Letter, digit or underscore (ASCII only) |
\W | Not a word character |
\s | Space, tab or line break |
\S | Not whitespace |
[abc] | One of a, b or c |
[^abc] | Anything except a, b or c |
[a-z] | One letter from a to z |
\. | A literal dot. A backslash escapes any special character |
\p{L} | Any letter (needs the u flag) |
| Token | Meaning |
|---|---|
^ | Start of the text (each line with m) |
$ | End of the text (each line with m) |
\b | Edge of a word |
\B | Not the edge of a word |
(abc) | Capture group, numbered from 1 |
(?:abc) | Group without capturing |
(?<name>abc) | Named capture group |
\1 | Same text as group 1 |
a|b | a or b |
(?=abc) | Followed by abc |
(?!abc) | Not followed by abc |
(?<=abc) | Preceded by abc |
(?<!abc) | Not preceded by abc |
| Token | Meaning |
|---|---|
* | Zero or more |
+ | One or more |
? | Zero or one |
{3} | Exactly 3 |
{3,} | 3 or more |
{3,5} | Between 3 and 5 |
*? +? | Lazy: as few as possible |
| Flag | Meaning |
|---|---|
g | Find all matches, not just the first |
i | Ignore upper and lower case |
m | ^ and $ work on every line |
s | The dot also matches line breaks |
u | Full Unicode support |
y | Match only at the current position |
| Token | Inserts |
|---|---|
$1 | Text of group 1 |
$<name> | Text of a named group |
$& | The whole match |
$` | Text before the match |
$' | Text after the match |
$$ | A dollar sign |
This tool uses the JavaScript (ECMAScript) flavour built into your browser. If your pattern was written for PHP, grep -P or another PCRE-style engine, expect these differences.
- No atomic groups
(?>…)or possessive quantifiers such asa++. - No recursion
(?R), conditionals or\K. - No
\A,\Zor\zanchors. Use^and$. - No inline flags such as
(?i)at the start. Use the flag boxes instead. - No free-spacing (x) mode. Spaces and
#are literal characters. - Named groups are
(?<name>…), not(?P<name>…). Refer back with\k<name>. - Without the m flag,
$matches only at the very end. PCRE also lets it match before a final line break. \d,\wand\bare ASCII only, so\wdoes not match “é”. Use\p{L}with the u flag for letters in any language.- Lookbehind works in current browsers, but older ones may reject it.
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:
- Highlighting: each match is shaded and capture groups are underlined and numbered.
- Match table: every match with its position and the value of each numbered and named group.
- Replace mode: the text after replacement, using tokens such as
$1,$<name>and$&. - Share link: the pattern, flags, test string and replacement are kept in the page address after the # symbol, so you can copy the link and send it on.
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.