Regular Expression Tester Online
Test and debug your regular expressions in real time with match highlighting, capture groups and a built-in cheat sheet.
Realtime
NEW
Espressione Regolare
/
/
String di test
Match trovati
Enter a regex and some text to see matches...
Cheat Sheet
Characters
.
Any character (except newline)
\d
Cifra [0-9]
\D
Non-digit
\w
Word char [a-zA-Z0-9_]
\W
Non-word character
\s
Whitespace
\S
Non-whitespace
Anchors
^
Start of string/line
$
End of string/line
\b
Confine di parola
\B
Non-word boundary
Quantifiers
*
0 or more times
+
1 or more times
?
0 or 1 time
{n}
Exactly n times
{n,}
At least n times
{n,m}
Between n and m times
Groups
(abc)
Capture group
(?:abc)
Non-capturing group
(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
a|b
Alternation (a or b)
How to use the Regex Tester
Enter your regular expression in the top field and the text to test in the text area. Matches are highlighted in real time. Click the flags to activate them (g = all matches, i = ignore case, m = multiline).
Click any token in the cheat sheet to automatically add it to the regex.
What are regular expressions?
Regular expressions (regex) define a search pattern. They are used to validate input, extract data, find and replace strings in PHP, JavaScript, Python and any other programming language.