Regular Expression Tester
Test and debug regular expressions with real-time matching
Common Patterns
Regex Flags Reference
- g - Global: Find all matches
- i - Ignore case: Case-insensitive matching
- m - Multiline: ^ and $ match line boundaries
- s - Dot all: . matches newline characters
- u - Unicode: Enable Unicode matching
- y - Sticky: Match only from lastIndex
About the Regex Tester
Write and test regular expressions against sample text and see matches highlighted in real time. The regex tester supports JavaScript regular-expression syntax with the global, case-insensitive, multiline and other flags, lists every match with its captured groups, and includes a library of common patterns such as emails, URLs, phone numbers and dates to start from. It is a quick way to debug a pattern before putting it into code.
How to use the Regex Tester
- Type your regular expression in the pattern field.
- Toggle flags such as g (global), i (case-insensitive) or m (multiline).
- Paste the text you want to search in the test area.
- Inspect the highlighted matches and the group breakdown, then copy the final pattern.
Frequently asked questions
Why does my pattern only find the first match?
Enable the g (global) flag. Without it, JavaScript regular expressions stop after the first match.
Does this use the same engine as my code?
It uses your browser's JavaScript engine, so results match Node.js and browser code. Other languages (Python, Java, PCRE) differ slightly in syntax.
How do I match across multiple lines?
Use the m flag so ^ and $ match at line boundaries, and the s flag if you want . to match newline characters.