Regex Tester
Test any regex against your text live: every match highlighted with its numbered and named groups, plus instant replacement preview — free and entirely in your browser.
Replace
🔒 Your code never leaves the browser — not one character is sent anywhere, and nothing is stored
How to use it
- Write a regex patternResults update instantly with any change to the pattern or flags.
- Paste the text to testEvery match is highlighted directly inside the text.
- Review each match’s detailsPosition plus numbered and named groups appear below the match list.
- Or try replacementType a replacement string (accepting $1, $<name>) and see the result instantly.
Enjoying the tool? Help us keep it free forever — Support OMXHub ❤️
Frequently Asked Questions
Why doesn’t my pattern work, even though I’m sure it’s valid?
The most common cause is mixing up regex flavors — a pattern that works in Python or PCRE may not work in JavaScript (which this tool uses, the exact engine your browser runs), especially around lookbehind and certain named-group syntax. If the pattern has an actual syntax error (a missing bracket, say), we show you the very error message returned by the JavaScript engine rather than guessing at the problem.
What does each of the five flags mean?
"g" finds all matches instead of just the first. "i" ignores letter case. "m" makes ^ and $ match the start and end of every line, not just of the whole text. "s" lets the dot (.) match newlines too. "u" enables proper Unicode mode — see the next question.
Why is the u (Unicode) flag on by default?
Without it, symbols needing more than one UTF-16 unit — most emoji, for instance — get split in half, and the dot (.) matches only half a symbol instead of the whole one. We enable it by default so matches are correct on real text containing emoji, but it remains a genuine toggle you can turn off if your pattern was written against older rules that don’t expect this behavior.
What’s the replacement syntax? ($1, $2, $<name>)
Standard JavaScript syntax: $1, $2... refer to numbered capture groups in order; $<name> refers to a named group (?<name>...); $& means the entire match; and $$ means a literal dollar sign. Experiment in the box and see results instantly before using it in your project.
My pattern is complex and the page briefly froze. Why?
Some patterns (especially nested repetition like a group repeating inside another repeating group) take exponential time on particular inputs — a known issue with every regex engine, not specific to this tool. Everything happens inside your own browser tab, so no one else is affected, but try a simpler pattern or shorter input if it happens.
Is my text or pattern uploaded to a server?
No, not a single character. All testing and replacing happen entirely inside your browser.