正则周二挑战赛 - 第一周

本周正则周二挑战是第一个挑战,任务是处理重复的单词。 这是个非常简单的挑战,今后的挑战也许会比这个难些。

你必须匹配替换重复的单词将它用 <strong> 元素包裹。 例如:this is is a test 应该被替换为 this is <strong>is</strong> a test

在你输入正则之后,每个测试用例都会标注为是否通过,红色是未通过,绿色是通过,因为是基于 web 的,所以只能使用基于 JavaScript 传统型 NFA (Traditional NFA)正则引擎。它类似于PCRE,但有一些不同之处。

测试用例 (0/11)

This is a test
This is a test
This is is a test
This is <strong>is</strong> a test
This test test is is
This test <strong>test</strong> is <strong>is</strong>
This test is a test
This test is a test
This this test is a test
This <strong>this</strong> test is a test
cat dog dog cat dog
cat dog <strong>dog</strong> cat dog
This test is a test tester
This test is a test tester
hello world hello world
hello world hello world
This nottest test is something
This nottest test is something
This is IS a test
This is <strong>IS</strong> a test
<Mack> I'll I'll be be back back in in a a bit bit.
<Mack> I'll <strong>I'll</strong> be <strong>be</strong> back <strong>back</strong> in <strong>in</strong> a <strong>a</strong> bit <strong>bit</strong>.
恭喜,你的正则通过了所有测试用例,记住要分享这个挑战哦。