Regex Tester is a Pro tool
Unlock this tool and all Pro features for just $5/month.
Upgrade to ProCancel anytime · All 15 free tools stay free forever
How to Use This Tool
Enter a pattern
Type your regular expression between the / delimiters.
Add test text
Paste or type the text you want to test against.
Review matches
Matches and capture groups are highlighted in real time.
Features
Real-Time Matching
Matches update instantly as you modify the pattern or test string.
Capture Groups
Named and numbered capture groups are displayed in a clear table.
Flag Support
Toggle global (g) and case-insensitive (i) flags.
Sample Patterns
Load pre-built sample patterns to learn regex syntax.
Frequently Asked Questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regexes are used for string matching, validation, search-and-replace, and data extraction in virtually every programming language.
What are capture groups?
Capture groups are portions of a regex enclosed in parentheses. They let you extract specific parts of a match. For example, (\d{3})-(\d{4}) matching 555-1234 captures 555 as group 1 and 1234 as group 2.
What does the g flag do?
The g (global) flag tells the regex engine to find all matches in the input, not just the first one. Without it, only the first match is returned.
Why is my regex slow?
Catastrophic backtracking occurs when a regex has nested quantifiers that create exponential matching paths. Avoid patterns like (a+)+ and use atomic groups or possessive quantifiers when available.