A regular expression, or regex, is a pattern for finding text, such as phone numbers or email addresses. Testing it on sample text before using it in code saves hours of debugging.
How to test
- Open Regex Tester and type your pattern.
- Paste test text below it.
- Choose flags, such as Global or Ignore case.
- See the matches highlighted and read the details.
Flags explained
- Global (g): find all matches, not only the first.
- Ignore case (i): treat A and a as the same.
- Multiline (m): ^ and $ match at each line.
- Dot matches newline (s).
- Unicode (u): handle all characters properly.
Useful building blocks
- \d is a digit and \w is a letter, digit or underscore.
- + means one or more and * means zero or more.
- Parentheses make a group you can capture.
Test with bad input too
Include text that should not match, so you know your pattern is not too loose.
Frequently asked questions
Is my data uploaded?
No. Everything runs in your browser, so what you type never leaves your device.
Ready to start?
Open Regex Tester