如to to,have have have,tomorrow tomorrow等等,语句如下:
You’d better to to hit the hay early as you you have have have an important examination tomorrow tomorrow.
我尝试了
([a-z]+[ ])\1+
但是tomorrow tomorrow.无法匹配
尝试了
([a-z]+)[ ]\1+
但是重复三遍等have无法完全匹配,还把不该匹配的地方匹配了
初学正则表达式,求教,谢谢。
(\b\w+\b)(?:\s\1)+
点击查看