给定以下句子:
The is 10. way of doing this. And this is 43. street.
我希望 preg_split() 给出这个:
Array (
[0] => "This is 10. way of doing this"
[1] => "And this is 43. street"
)
我在用:
preg_split("/[^\d+]\./i", $sentence)
但这给了我:
Array (
[0] => "This is 10. way of doing thi"
[1] => "And this is 43. stree"
)
如您所见,每个句子的最后一个字符都被删除了。我知道为什么会发生这种情况,但我不知道如何防止它发生。有任何想法吗?前瞻和后瞻可以在这里提供帮助吗?我对那些不是很熟悉。