Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(\S+\s*)\1{2,}
/
g
Input 1
1
singleton duplicate duplicate triplicate triplicate triplicate (not a space after third triplicate, it is a newline) singleton duplicate duplicate triplicate triplicate triplicate (it matches this time because I added a space after third triplicate) (next does not match because there is no white space at the end of the line) singleton duplicate duplicate triplicate triplicate triplicate
Substitution
singleton duplicate duplicate triplicate triplicate triplicate (not a space after third triplicate, it is a newline) singleton duplicate duplicate triplicate triplicate triplicate (it matches this time because I added a space after third triplicate) (next does not match because there is no white space at the end of the line) singleton duplicate duplicate triplicate triplicate triplicate