Test regular expressions in real-time — highlight matches, inspect groups, replace and validate
Enter a regular expression and sample text to see matches highlighted as you type, inspect capture groups, test flags and try search-and-replace before using the pattern in your code. More free security tools.
Regular expressions are deceptively easy to get subtly wrong — a greedy quantifier that backtracks catastrophically, a capture group that shifts index when you add a new group earlier in the pattern, or a flag you forgot to set. This tester runs your pattern against the browser's native RegExp engine (the same engine your JavaScript code will use), so what you see here is what you'll get in production.
Matches highlight live as you type, capture groups are broken out individually so you can confirm you're referencing the right one, and the search-and-replace panel lets you test a substitution pattern — including backreferences — before you commit it to code.
Need help building secure input validation and WAF rules for your applications?
If you like this tool, Speak with OneFirewallRegular expressions power log parsing, input validation, SIEM rules and detection signatures, and a small mistake can miss attacks or match far too much.
Test a pattern against sample text with live highlighting, inspect capture groups, try flags and run search-and-replace before using it in code.
Quantifiers like .* are greedy by default. Use lazy quantifiers (.*?), anchors (^ and $) or more specific character classes.
Some patterns with nested quantifiers take exponential time on certain inputs, which attackers can exploit to cause denial of service (ReDoS). Avoid nested repetition such as (a+)+.
It uses your browser's JavaScript regular expression engine, so behaviour can differ slightly from PCRE, Python or Go.
More free tools: OneFirewall Free Tools · Terms explained: Glossary