Regex Tester
Test a regular expression against your text with live match highlighting and flags. Free and in-browser.
- #1@ 14hello@toolko.dev
- #2@ 34support@toolko.dev
How to use the Regex Tester
- 1Type or paste your regular expression into the pattern field at the top; no surrounding slashes needed.
- 2Toggle the flags you want: g for every match, i for case-insensitive, m for multiline ^ and $, s for dotAll, u for unicode.
- 3Paste or type your sample text into the test box below the pattern.
- 4Watch matches highlight inline as you edit the pattern, so you can narrow it one token at a time.
- 5Open the results panel to read each match's numbered groups, named groups, and start/end positions.
- 6Copy the finished pattern (or the extracted matches) straight into your Node.js, front-end, or editor search box.
About the Regex Tester
Regex Tester runs a regular expression against your own sample text and highlights exactly what it matches, character by character, the moment you stop typing. You put your pattern in the regex field at the top, flip on the flags you need, and drop your test string into the box below. Matches light up inline, and a results panel splits each one into its capture groups, its named groups, and its start and end indices, so you can prove the pattern does what you think before you trust it. The engine is the browser's own JavaScript RegExp, which means the exact syntax you validate here pastes straight into Node.js, a React component, or a `String.replace` call with no dialect surprises. Everything happens client-side in your tab. Your pattern and your test data are never uploaded, stored, or logged, which matters when the text you are matching against is a batch of real emails, production log lines, leaked API keys you are scrubbing, or customer records. The situations that send people here are concrete: checking whether an email or phone-validation pattern accepts the awkward inputs (plus-addressing, `+` country codes, unusual TLDs) instead of only the tidy ones; pulling timestamps and status codes out of log files; drafting a find-and-replace before you unleash it on a whole repo; or working out why a greedy `.*` is swallowing three fields instead of one. The `g` flag switches you from first-match to every-match, `i` spares you from writing `[Aa][Bb]` by hand, and `m` changes where `^` and `$` land on multi-line input. Backend developers, QA engineers, and data analysts who live in `grep`, `sed`, or an editor's search box all end up building patterns faster here. One habit pays off: build incrementally, add a single group at a time, and watch the group breakdown so a stray unescaped parenthesis becomes an obvious extra capture rather than a bug you ship. Seeing matches update live turns regex from guess-and-rerun into something you can actually read.
Frequently asked questions
Which regex flavor does this tester use?
It uses the browser's native JavaScript RegExp engine, so what passes here is exactly what runs in Node.js or front-end code. Named groups (?<name>...), lookahead, lookbehind, backreferences, and the u and s flags all work. PCRE-only features like recursion, possessive quantifiers, and inline (?i) modifier groups are not supported, because JavaScript itself does not support them.
Why do I only see the first match instead of all of them?
Without the global flag the engine stops after the first match. Turn on the g flag to highlight and list every occurrence. If your pattern also uses ^ or $ and your text has several lines, add the m flag so those anchors match at each line break instead of only at the very start and end.
Does my test data or pattern get sent anywhere?
No. Matching happens entirely in your browser tab using JavaScript RegExp. Your pattern and test text are never uploaded, saved, or logged, and closing the tab discards them, so it is safe to paste real log files, emails, API keys, or other sensitive data you are trying to match or scrub.
How do I read my capture groups?
Every pair of parentheses becomes a numbered group in the results panel, listed under each match. Write (?<year>\d{4}) and that group also appears under the name 'year'. This is the fastest way to confirm you are capturing the right substring and to spot an accidental extra group before the pattern reaches your code.
How do I match a literal special character like a dot or parenthesis?
Escape it with a backslash. A bare . matches any character, so use \. for a literal period, and \( \) \[ \] \{ \} \+ \* \? \| \^ \$ \\ for those literal symbols. The live highlighting tells you instantly whether the escape landed: the match should now stop on the literal character instead of running past it.
Related tools
Browse all free online tools in Text tools and more.
Frequently asked questions
Are flags supported?+
Yes — toggle g, i, m, s flags and see matches highlighted live.