About this tool
This free online regex tester highlights every match in real time as you edit the pattern, flags, or test string. Your text is never uploaded: matching runs locally in your browser, so it is safe to paste logs, source code, or any data you would not send to a random server. It uses the JavaScript regex flavor — the same engine that runs in Node.js and every browser.
How to use
- Pattern — type a regular expression between the slashes; syntax errors are reported immediately below.
-
Flags — toggle
g,i,m,s,u, andyto change how matching behaves. - Test string — paste or type text in the editor; matches are highlighted in alternating colors so adjacent matches stay distinguishable.
- Match list — every match is listed with its character range and capture groups (numbered and named); click one to scroll the editor to it.
-
Replace — open the Replace row and enter a
replacement pattern to preview the substituted text live.
$1inserts capture group 1,$<name>a named group,$&the whole match, and$$a literal dollar sign.
Flag reference
-
gglobal — find all matches instead of stopping at the first one. -
iignoreCase — match letters regardless of case. -
mmultiline — make^and$match at the start and end of each line, not just the whole string. -
sdotAll — let.match newline characters too. -
uunicode — treat the pattern as Unicode; surrogate pairs (like emoji) count as one character and\p{...}property escapes become available. -
ysticky — only match starting exactly at the current position, useful when writing tokenizers.
FAQ
Is my text uploaded to a server? No. Matching runs in a Web Worker inside your browser. Nothing leaves your machine.
Which regex flavor does this use? JavaScript
(ECMAScript). It supports lookahead, lookbehind, named capture groups
(?<name>...), and Unicode property escapes, but
not PCRE-only features such as recursion or possessive quantifiers.
Why did my pattern get stopped? Some patterns (like
(a+)+$ against a long string of a's) trigger
catastrophic backtracking and could freeze the page. This tool runs
matching in a background thread and stops any pattern that takes
longer than half a second.