匹配连续出现的重复单词(不限次数):
/(\b\S+\b) (\b\1\b( \b\1\b)*)/gi
Replaced with:
$1 <strong>$2</strong>
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
本文介绍了一种使用正则表达式匹配文本中连续重复单词的方法,并提供了具体的正则表达式及其替换规则,有助于理解和应用正则表达式解决实际问题。
匹配连续出现的重复单词(不限次数):
/(\b\S+\b) (\b\1\b( \b\1\b)*)/gi
Replaced with:
$1 <strong>$2</strong>
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

被折叠的 条评论
为什么被折叠?