Regex Tester & Debugger
Test and debug regular expressions in real time. Type your pattern and test string to instantly see highlighted matches and captured groups.
About This Tool
Regular expressions (regex) are powerful patterns used to match character combinations in strings. They are fundamental to text processing, data validation, search and replace operations, and parsing structured text. This regex tester online lets you test JavaScript-flavored regular expressions in real time — as you type, matches are highlighted immediately.
Regular expressions can be tricky to get right. A small mistake in the pattern can lead to unexpected matches or no matches at all. This tester eliminates the guess-work by giving you instant visual feedback: matched portions of your test string are highlighted in yellow, the total match count is shown as a badge, and captured groups are displayed in a table below.
The tool supports all standard JavaScript regex flags: g (find all matches, not just the first), i (case-insensitive matching), and m (multiline mode where ^ and $ match line boundaries). If your pattern is invalid, a clear error message explains the syntax problem.
How to Use
- Enter your regular expression pattern in the Pattern field (without the surrounding slashes).
- Check or uncheck the flags you need: g for global, i for case-insensitive, m for multiline.
- Paste your test string into the Test String area.
- Matches are highlighted automatically as you type — no button press needed.
- The match count badge shows how many matches were found.
- If your pattern contains capturing groups
(...), the captured values are shown in the table below.
Regex Quick Reference
.— any character except newline\d— digit (0–9),\w— word char,\s— whitespace*— 0 or more,+— 1 or more,?— 0 or 1{n,m}— between n and m repetitions^— start of string,$— end of string[abc]— character class,[^abc]— negated class(abc)— capturing group,(?:abc)— non-capturing group