标点符号的字符串差异:是preg_split答案


String diff on punctuation: is preg_split the answer?

http://piratepad.net/IY48xXzsys(由Peter West修改,原文如下:http://paulbutler.org/archives/a-simple-diff-algorithm-in-php/)

目前,"我认为,因此"answers"我认为因此"之间的差异将产生:

I < del >think,< /del >< ins >think< /ins > therefore

我希望它生产:

I think< del >,< /del > therefore

我认为答案是将逗号作为一个单独的实体包含在preg_split函数产生的数组中。我试着摆弄括号,但没能使它起作用。你能帮我吗?

我认为在对split的调用中向分隔符添加逗号就可以了。