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
r'''
(\b\w+\b)([ ]+\1\b)+
'''
msg
Input 1
1
New
the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the the little cat cat is in the hat hat hat, we like it. the the the little cat cat2 is in the hat hat hat2, we like it. aa abb bc ab bbc cd dc dc dc eg
Substitution
\1
the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the little cat cat is in the hat hat hat, we like it. the the little cat cat is in the hat hat hat, we like it. the the the little cat cat2 is in the hat hat hat2, we like it. aa abb bc ab bbc cd dc dc dc eg