Regex Tester
Write a pattern and see matches highlighted in your test text as you type.
🔒 Your files and text never leave your device. Everything is processed in your browser.
How to use
- Type a regular expression and flags such as g or i.
- Paste the text to test.
- Check the matches and groups, and try a replacement if you like.
Common patterns to start from
\d+ matches one or more digits, \s matches whitespace, ^ and $ mark the start and end of a line, and [A-Za-z]+ matches a run of Latin letters. Capture groups in parentheses let you pull out parts of a match, such as the year from a date.
Flags that change matching
g finds every match instead of only the first, i ignores upper and lower case, and m makes ^ and $ apply to each line. This tester uses the JavaScript regex engine, which is close to, but not identical with, the engines in Python, PHP or Java.
Frequently asked questions
Which regex flavor is used?
JavaScript (ECMAScript), the same engine as your browser.
How do I use groups in a replacement?
Write $1, $2 and so on for each captured group.