正则周二挑战赛 - 第十周

我们的挑战迎来了两位数! 本周挑战是 /u/jordanreiter 的主义; 该挑战是把一个句子转为合适搜索的 'tokens' 关键词。
例如 - "don't tell Suzie Smith-Hopper that I broke Daniel's toy horse"
应转为 "don't,tell,Suzie,Smith-Hopper,that,I,broke,Daniel's,toy,horse"
并且 "other "big name" items" 应该转为 "other,big name, items"。

四个标准如下:

这是个具有挑战性的挑战! 当然他是可以实现的,加油。

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

测试用例 (0/17)

This is a test
This,is,a,test
This is another test
This,is,another,test
This "big test" is a test
This,big test,is,a,test
This "big test" is a 'big test'
This,big test,is,a,big test
Almost "this entire" thing "is just a" quote
Almost,this entire,thing,is just a,quote
Suzie Smith-Hopper
Suzie,Smith-Hopper
Suzie Smith-Hopper is test
Suzie,Smith-Hopper,is,test
Suzie Smith-Hopper is--test
Suzie,Smith-Hopper,is,test
This----is--test
This,is,test
This-----is-test
This,is-test
Don't say anything
Don't,say,anything
I can't think
I,can't,think
This' is a 'test
This,is,a,test
don't tell Suzie Smith-Hopper that I broke Daniel's toy horse
don't,tell,Suzie,Smith-Hopper,that,I,broke,Daniel's,toy,horse
I can't see Suzie Smith-Hopper anywhere; can you
I,can't,see,Suzie,Smith-Hopper,anywhere,can,you
Too long; didn't read
Too,long,didn't,read
Suzie Smith-Hopper's car was stolen
Suzie,Smith-Hopper's,car,was,stolen
恭喜,你的正则通过了所有测试用例,记住要分享这个挑战哦。