Regex Tester
Test regular expressions live — match highlighting, capture groups, replace preview and a cheat sheet. Runs in your browser, with runaway-pattern protection.
Advertisement
Test string
matches update as you type
Result
Enter a pattern and some test text, or press
Sample.
Matches 0
Groups 0
Time —
Length 0
Cheat sheet
. any character\d digit \D non-digit\w word char \W non-word\s whitespace \S non-space[abc] any of a, b, c[^abc] none of them[a-z] range\b word boundary* 0+ + 1+ ? 0 or 1{2,5} 2 to 5 times+? lazy (shortest match)(…) capture group(?:…) non-capturing(?<n>…) named groupa|b either^ start $ endAbout this tester
This uses the JavaScript (ECMAScript) regex engine, the same one
your browser and Node.js use. Java's java.util.regex is very close, but differs on a few
things — Java needs double backslashes in string literals ("\\d"), and supports
possessive quantifiers (a++) which JavaScript does not.
Patterns run inside a Web Worker with a time limit, so a
catastrophic pattern like (a+)+$ is stopped instead of freezing the page.