Regex Tester

Online Regex Tester & Debugger

Test, debug, and replace regular expressions with the native JavaScript engine. 100% client-side execution — nothing you type ever leaves your browser.

Enter the pattern only — the slashes are visual delimiters.

Flags

Highlighted matches

Read-only preview
The highlighted preview appears here.

Match Results

No matches found

Enter a pattern and some text to see matches here.

Backreferences: $1, $&, $<name>. The result below updates as you type.

Replace Result

0 replacements
The replaced text appears here.

Regex Cheat Sheet

Quick reference for the syntax supported by the native JavaScript engine.

Character classes

.Any character except newline (unless the s flag is set)
\dDigit (0-9)
\wWord character (letter, digit, underscore)
\sWhitespace
[abc]Any one of a, b, or c
[^abc]Any character except a, b, or c

Quantifiers

*Zero or more
+One or more
?Zero or one
{3}Exactly three
{2,5}Between two and five
*?Lazy version of *

Anchors and boundaries

^Start of input, or of a line with the m flag
$End of input, or of a line with the m flag
\bWord boundary
\BNot a word boundary

Groups and references

(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named capturing group
\1Backreference to group 1
a|bAlternation (a or b)
(?=abc)Positive lookahead
(?!abc)Negative lookahead

How to use this regex tester

  1. 1. Add your test string. Paste or type the text you want to inspect. Use “Load sample text” to try the tool with a ready-made example.
  2. 2. Enter a pattern and pick flags. Type the expression without slashes. Toggle g, i, m, and s to change matching behaviour.
  3. 3. Review every match. The results list shows the matched text, its index, and every capture group. Click a result to scroll the highlighted preview to that match.
  4. 4. Build a replacement. Use $1, $&, or $<name> to reference captured text. The result updates as you type, and you can copy or download it as a text file.
  5. 5. Save useful patterns. History keeps the last 20 contexts in your browser only. Restore an entry to bring back the pattern, flags, test string, and replacement.

Everything runs locally. No account, no server, no upload.

Frequently asked questions

Is my data sent to a server?
No. Every regular expression, test string, replacement, and history entry stays in your browser. The page runs entirely client-side and never uploads your input.
Which regular expression engine does this tool use?
It uses the built-in JavaScript RegExp engine of your browser, so matches, capture groups, and replacements behave exactly like they do in your own code.
What do the g, i, m, and s flags mean?
g finds every match instead of the first one, i ignores letter case, m makes ^ and $ match line boundaries, and s lets the dot match newline characters.
Why does my pattern match empty strings?
Patterns such as a* or .* can match zero characters. The tester advances the search position safely so the browser never freezes, and zero-width matches are still listed.
Where is my history stored?
In your browser local storage, limited to the 20 most recent entries. It never leaves your device. If storage is disabled, the tester keeps working without saving history.
Can I use the replacement syntax from JavaScript?
Yes. $1, $2, $& and $<name> work exactly as in String.prototype.replace. In addition, \n and \t in the replacement become a newline and a tab.
Does this tool require an account?
No. There is no sign-up, no login, and no database. Open the page and start testing immediately.

All processing happens in your browser. Nothing is uploaded. History stays in local storage and never leaves your device.

Regex Tester & Replacer — built for developers worldwide.