Free Online Regex Tester
Quick answer: Debug your patterns in real time. Our free regex tester evaluates JavaScript regular expressions as you type — with live match highlighting, a full match list showing capture groups and positions, all five regex flags, and a find-and-replace mode. Your test data never leaves your browser.
Debug your patterns in real time. Our free regex tester evaluates JavaScript regular expressions as you type — with live match highlighting, a full match list showing capture groups and positions, all five regex flags, and a find-and-replace mode. Your test data never leaves your browser.
0 matches
Find and Replace
✓ Free forever · ✓ No signup · ✓ Runs in your browser — your data never leaves your device.
How to Use the Regex Tester
- Type your regular expression into the pattern box — results update live as you type.
- Toggle the flags: g for all matches, i for case-insensitive, m for ^$ per line, s for dot-matches-newline, u for Unicode.
- Paste your test text and watch matches highlight in yellow with a full match list below.
- Click a sample pattern (email, URL, phone…) to load a working example instantly.
- Use Find and Replace with $1, $2 backreferences to rewrite matched text.
Why Use Our Regex Tester?
- Live evaluation — every keystroke re-tests; invalid patterns show the exact engine error.
- Match highlighting — every match is highlighted in your text, with index positions and capture groups listed.
- All five JS flags — global, ignore-case, multiline, dotAll, and unicode, toggleable individually.
- Find and replace mode — rewrite matches with backreference support ($1, $2, $&).
- Private by design — patterns and test data are evaluated locally; nothing is sent to a server.
Frequently Asked Questions
What is a regular expression?
A pattern-matching language for text: \d+ finds runs of digits, [A-Z]+ finds uppercase words, ^https?:// matches URLs at a line start. This tester evaluates patterns with your browser's built-in JavaScript regex engine — the same engine Node.js and browsers use.
Why does my pattern show as invalid?
The tester passes your pattern straight to JavaScript's RegExp constructor, so any syntax the engine rejects — unbalanced parentheses, a stray backslash, an unescaped / — is flagged with the engine's exact error message. Fix the reported spot and it re-tests instantly.
What do the g, i, m, s, and u flags do?
g (global) finds all matches instead of stopping at the first; i makes matching case-insensitive; m makes ^ and $ match at line boundaries instead of just string ends; s lets . match newlines; u enables full Unicode handling (so emoji and astral characters match correctly).
Why isn't my regex matching anything?
The usual culprits: a missing g flag (only the first match is returned), unescaped special characters like . or ( in your data, case differences without the i flag, or ^/$ anchors when you meant to match mid-string. Toggle the flags and check the live highlight.
Can I use lookbehind assertions?
Yes — (?<=...) and (?
Is my test data sent to a server?
No. The pattern is compiled and run by your own browser's JavaScript engine. Test strings, however sensitive, never leave your device.