Regex Tester
Test regular expressions with real-time matching and detailed analysis
Regular Expression
/
/
Enter a regex pattern
0 matches
Flags
Test String
Characters: 0
Lines: 0
Test Results
Enter a regex and test string to see matches
Match Details
No matches found
Find & Replace
Replace Result
Enter replacement string and click "Test Replace"
Quick Patterns
Regular Expression Guide
Regular expressions (regex) are powerful patterns used for matching and manipulating text. This tool helps you test and debug your regex patterns in real-time.
Basic Syntax
.
Matches any character except newline
*
Matches 0 or more of the preceding element
+
Matches 1 or more of the preceding element
?
Matches 0 or 1 of the preceding element
^
Matches the start of a string
$
Matches the end of a string
[abc]
Matches any character in the brackets
[^abc]
Matches any character NOT in the brackets
()
Groups expressions and captures matches
|
Alternation (OR operator)
Character Classes
\d
Matches any digit (0-9)
\w
Matches any word character (a-z, A-Z, 0-9, _)
\s
Matches any whitespace character
\D
Matches any non-digit
\W
Matches any non-word character
\S
Matches any non-whitespace character
Quantifiers
{n}
Matches exactly n occurrences
{n,}
Matches n or more occurrences
{n,m}
Matches between n and m occurrences
Flags
- g (global): Find all matches rather than stopping after the first match
- i (ignore case): Case-insensitive matching
- m (multiline): ^ and $ match start/end of line, not just start/end of string
- s (dot all): . matches newline characters
- u (unicode): Enable full Unicode matching
- y (sticky): Matches only from the index indicated by lastIndex