Regex Tester
Test regular expressions live against sample text.
Related Tools
// more about this tool
Why use this tool
Regex is notoriously easy to get subtly wrong — a pattern that matches your one example input can fail on the next one, and the only reliable way to catch that is testing against real, varied sample strings, not just staring at the pattern until it looks right. This tool writes a pattern and test text side by side, and matches highlight as you type, along with capture groups broken out individually below.
Dart's RegExp class supports the same core syntax as JavaScript's regular expressions, so a pattern validated here generally carries straight over into Dart code with no translation needed.
How it works
- Type a pattern into the Pattern field, or click one of the quick-pattern presets (Email, URL, Phone).
- Toggle flags — Global, Ignore case, Multiline, Dot-all — to change matching behavior.
- Edit the test string and watch matches highlight live.
- Scroll the match list below to see each match's full text and any capture groups.
Example
Pattern and sample input
Pattern: [\w.+-]+@[\w-]+\.[\w.-]+
Flags: g, i
Input: Contact us at hello@bidev.dev or visit https://bidev.dev
Match: hello@bidev.devFAQ
Does Dart's RegExp support everything tested here?
Dart's RegExp is built on the same core engine family as JavaScript's and supports the same fundamental syntax — character classes, groups, lookaheads, quantifiers, and the flags this tool exposes — so a pattern validated here generally carries over directly.
Why do capture groups show separately from the full match?
A capture group — the part of your pattern wrapped in parentheses — is often the piece you actually want to extract (like the domain out of an email match), so it's broken out from the full matched text to save you writing extra code to pull it out yourself.
What do the flags actually change?
Global finds every match in the string instead of stopping at the first; Ignore case makes letter matching case-insensitive; Multiline makes ^ and $ match the start and end of each line rather than the whole string; Dot-all makes . also match newline characters.
Is there a way to test multiline input?
Yes — the test string textarea accepts multiple lines directly, and the Multiline flag changes how ^ and $ behave against that multi-line text.
What are the quick-pattern presets for?
Email, URL, and Phone are ready-made patterns for the three things developers test most often, so you can start from a working pattern and tweak it rather than writing one from scratch — click any preset to load it into the Pattern field.
Why does my pattern match nothing even though it looks right?
The most common cause is a flag mismatch — forgetting Ignore case when your test text has different capitalization, or forgetting Global so you only ever see the first match. Check the error message area too: an invalid pattern (unbalanced parentheses, a bad escape) shows the regex engine's own syntax error instead of silently matching nothing.