Regex Tester
Test patterns live
.any char except newline\ddigit 0-9\wword [A-Za-z0-9_]\swhitespace\bword boundary*0 or more+1 or more?0 or 1{n,m}between n and m^ $start / end(abc)capture group(?:abc)non-capture(?<name>x)named group[abc]character classa|balternationWhat is Regex Tester?
Test a regular expression against sample text with live match highlighting, capture-group inspection, and flag toggles (g, i, m, s, u, y). Useful for prototyping a pattern before pasting it into code, debugging a regex that isn't matching as expected, or teaching someone how a particular expression behaves.
How do I use Regex Tester?
- Enter your regex in the pattern field and set flags.
- Paste sample text into the input panel.
- Matches are highlighted live; expand a match to see named + indexed capture groups.
Regex Tester by the numbers
- Engine
- Native RegExp (V8 / SpiderMonkey)
- Flags
- g, i, m, s, u, y
- Named groups
- Supported (?<name>...)
- Replace preview
- Yes, with $1 / $<name> refs
- Max haystack size
- ~1 MB comfortably
Common use cases for Regex Tester
- Validating an email-address pattern against a fixture list.
- Extracting every URL from a block of prose.
- Debugging a parser for log-file timestamps.
- Converting a Python regex to JavaScript by testing edge cases.
- Building a redaction rule for phone numbers in user content.
Common pitfalls and how to avoid them
- Backreferences inside lookbehind fail — JavaScript regex does not support them. Restructure using a lookahead or a two-pass replace.
- Unicode characters do not match — Add the u flag and use \p{Letter} / \p{Number} property escapes instead of ASCII-only classes.
- Greedy pattern consumes too much — Switch to lazy quantifiers (*? and +?) or tighten the character class inside the group.
When should I use Regex Tester?
Regex Tester is for JavaScript regex semantics (same engine your app uses). For a language-specific engine (Python, Go, PCRE), behaviours differ on edge cases — prototype here, then verify in your language.
Which regex flavour does the tester use?
JavaScript regex (same engine as browsers and Node.js). Most PCRE features are supported; backreferences inside lookbehinds and recursion are not.
Which flags can I enable?
g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), y (sticky). Flags can be toggled individually without editing the pattern.
What do the coloured groups mean?
Each capturing group is highlighted in a different colour. Named groups (?<name>…) are labelled by name in the match table.
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.