Regex Tester
DeveloperNewWrite a regex pattern, apply flags, and see matches highlighted in real time. Shows capture groups.
Frequently asked questions
How do I test a regular expression against sample text?
Enter your pattern in the regex field, apply flags like g, i, m, or s, and paste your test text below. Matches highlight live as you type, with capture groups broken out separately so you can confirm the pattern works before using it in code.
What do the g, i, m, and s regex flags actually do?
g finds all matches instead of stopping at the first, i makes matching case-insensitive, m lets ^ and $ match at line breaks within multiline text, and s lets the dot character also match newlines.
Why does my regex work in this tester but fail in my code?
Regex flavors differ slightly between languages. This tester uses JavaScript's regex engine, so patterns relying on features unique to PCRE, Python's re module, or POSIX regex may behave differently elsewhere.
Can I see named or numbered capture groups separately?
Yes, each match is broken down to show its full match alongside any capture groups defined with parentheses in your pattern, so you can verify group extraction before wiring the regex into your application.