Regex Tester
Live regex testing with match highlighting, capture groups, replace mode, and 12 common patterns.
//g
Common Patterns
Enter a regex pattern and test string above to see matches
About Regex Tester
Test and debug regular expressions in real time. Highlights matches, shows capture groups, supports all JS flags, includes 12 common patterns, and has a replace mode. Free online regex tester.
How to Use
- 1Enter your regex pattern in the pattern field (without slashes).
- 2Toggle the flags you need: g, i, m, s.
- 3Paste your test string — matches are highlighted in real time.
- 4Click a match card to focus it in the preview.
- 5Switch to Replace mode and enter a replacement string to see the replaced result.
- 6Use the Common Patterns buttons to quickly insert popular patterns like email or URL.
Frequently Asked Questions
Which regex flavour does this use?
JavaScript's built-in RegExp engine — the same one used in Node.js and all major browsers.
What flags are supported?
g (global), i (case insensitive), m (multiline), and s (dotAll — dot matches newlines).
Can I see capture groups?
Yes. Each match card shows numbered groups ($1, $2…) and named groups if your pattern uses (?<name>...).
What is Replace mode?
Switch to Replace mode, enter a replacement string (use $1, $2 for groups), and see the result of testString.replace(regex, replacement) instantly.
Tool Info
- Category
- dev
- Usage
- Unlimited
Related Tools
More dev tools
JSON Formatter
Format, validate, and beautify JSON data.
Base64 Encode/Decode
Encode text to Base64 or decode Base64 to text.
Encoder / Decoder
Encode & decode text with 15+ formats: Base64, URL, Hex, Binary, Morse, ROT13, JWT, SHA-256 and more.
GitHub Repository Scanner
Visualize any public GitHub repo: file tree, stats, README, and contributors.