Regex Tester & Debugger
Test and debug regular expressions online for free. Match, highlight, and explain regex patterns in real time.
About this tool
The Regex Tester lets you write, test, and debug regular expressions in real time. Enter your regex pattern and test string to instantly see all matches highlighted. Supports all standard JavaScript regex flags (g, i, m, s, u). Shows match groups, indices, and a match list for easy debugging. Essential for developers working with string parsing, validation, and text processing.
How to use Regex Tester
- 1Enter your regex: Type your regular expression pattern in the regex field (without surrounding slashes).
- 2Add test string: Enter the text you want to test against in the test string area.
- 3Select flags: Choose flags like g (global), i (case-insensitive), m (multiline) as needed.
- 4View matches: Matches are highlighted in yellow in the test string. All matches are listed below.
Frequently Asked Questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used for string matching, searching, and replacing text.
What regex flags are supported?
This tester supports standard JavaScript flags: g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode).
How do I match an email address with regex?
A common email regex is: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/. Note that perfect email validation is complex.
What does the ^ and $ mean in regex?
^ matches the start of a string (or line in multiline mode). $ matches the end of a string (or line).