标签: regex
有时候,我有时会在文字中发现整个短语。
The reason the reason why they cleaned....
\ b(\ w +)\ s + \ 1 \ b 找到重复的单词,但不是短语。
答案 0 :(得分:2)
你可以使用正则表达式
\b(\w+(?:\s*\w*))\s+\1\b
查看演示here