Regex Tester
Test regular expressions against sample text with live matches, or start from a common pattern.
✓ 3 matches[< 1 ms]
test-string.txt
Matches (3)
Questions
Which regex flavor does this use?
JavaScript, exactly as your browser runs it. That's the same engine as Node.js, Deno and TypeScript code. Most everyday syntax works the same in Python, Java, PHP and .NET, but a few features differ, such as possessive quantifiers and inline flags like (?i), which JavaScript doesn't support.
Why does it only find the first match?
Without the g (global) flag, a regular expression stops after its first match. Turn on g to find every match in the text. The common patterns already have it switched on.
Why do ^ and $ only match once?
By default ^ means the start of the whole text and $ the end. Turn on the m (multiline) flag to make them match at the start and end of every line, which is what you want when checking a list of values one per line.
What does "stopped after 2 seconds" mean?
Some patterns, usually ones with nested quantifiers like (a+)+ or (.*)*, can take exponentially long on text that almost matches. This is called catastrophic backtracking. The tester stops such runs so the page stays responsive. In production code the same pattern could hang a server, so it's worth rewriting it to be more specific.
Is my text sent anywhere?
No. Patterns and test text stay in your browser. Nothing is uploaded or stored.