MagicTools

Regex Tester

Test regular expressions in real time with match highlighting

//g
Hover flags for details
2 matches
Hello world, contact us at hello@example.com or support@magictools.io for help.
#1hello@example.com
[2744]
Group 1: helloGroup 2: example.com
#2support@magictools.io
[4869]
Group 1: supportGroup 2: magictools.io

How to use / Why use this tool / FAQ

How to use

Enter your regular expression in the pattern field. Toggle flags (g, i, m, s, u) as needed. Type your test string below — matches are highlighted in real time with group details.

Why use this tool

Test and debug regular expressions instantly without switching tools. See all matches highlighted, with capture group breakdown per match. No install, works offline.

FAQ

What does the 'g' flag do?
Global flag — finds all matches in the string. Without it, only the first match is returned.
How do I match across multiple lines?
Enable the 'm' (multiline) flag so ^ and $ match line boundaries. Use 's' (dotAll) to make . match newline characters.
Are named capture groups supported?
Yes. Use (?<name>...) syntax. Named groups appear in the match details panel.