Regex Tester Tool
Free online tool to test, debug, and validate regular expressions. Experiment with regex patterns in real-time with detailed matching results.
Results will appear here. Enter a regex pattern and test text, then click "Test".
Real-time Testing
Test your regular expressions against sample text with immediate feedback and highlighting of matches.
Debugging Tools
Identify issues in your patterns with detailed error messages and match information.
Regex Flags
Toggle between different regex flags (like global, case-insensitive) to see how they affect matching.
Regex Cheatsheet
Pattern | Description | Example |
---|---|---|
. |
Any character except newline | a.c matches "abc", "a2c", etc. |
\w |
Word character (a-z, A-Z, 0-9, _) | \w+ matches words |
\d |
Digit (0-9) | \d{3} matches 3 digits |
^ |
Start of string (or line with m flag) | ^Hello matches "Hello" at start |
$ |
End of string (or line with m flag) | end$ matches "end" at end |
* |
0 or more of preceding element | a*b matches "b", "ab", "aab", etc. |
+ |
1 or more of preceding element | a+b matches "ab", "aab", etc. |
? |
0 or 1 of preceding element | a?b matches "b" or "ab" |
{n} |
Exactly n occurrences | a{3} matches "aaa" |
[abc] |
Any of a, b, or c | [aeiou] matches vowels |
(...) |
Capturing group | (abc)+ matches "abc", "abcabc", etc. |
\s |
Whitespace character | \s+ matches spaces/tabs |
\b |
Word boundary | \bword\b matches whole word |
How to Use the Regex Tester
Enter Your Regex Pattern
Type your regular expression in the pattern field. Use the checkboxes to toggle regex flags that affect matching behavior.
Provide Test Text
Enter or paste the text you want to test your regular expression against in the test text area.
Analyze Results
Click "Test" to see matches highlighted in the text and get information about the number of matches found.