Free › Regex Tester
Free live tool
Regex Tester.
Write a pattern, see what it matches, and read it in plain English. Runaway patterns are stopped, not left to freeze your tab.
Runs in your browser. Nothing you type is uploaded. Uses JavaScript regular expressions.
Tester
Match, replace, explain.
Start from a security preset or write your own. Results update as you type.
Backtracking and ReDoS
When a pattern turns on you.
Take as much, or as little.
.* grabs everything it can, then gives some back. .*? takes the least it can. Most surprise matches come from this one choice.
Say where it must match.
^ and $ pin a match to the start and end. \b marks a word edge. Without them, a pattern for a 4 digit number will happily match inside a 12 digit one.
Some patterns never finish.
Nested repeats such as (a+)+ can take longer with every extra character. An attacker who can send such input can freeze a server. This tool stops any pattern after two seconds.
More free tools.
Lessons, tools and datasheets. No sign-up.