小编Sco*_*ler的帖子

如何将段落分成句子

我一直在尝试使用:

$string="The Dr. is here!!! I am glad I'm in the U.S.A. for the Dr. quality is great!!!!!!";
preg_match_all('~.*?[?.!]~s',$string,$sentences);
print_r($sentences);
Run Code Online (Sandbox Code Playgroud)

但它不适用于Dr.,USA等.

有没有人有更好的建议?

php regex split text-segmentation

2
推荐指数
1
解决办法
5276
查看次数

标签 统计

php ×1

regex ×1

split ×1

text-segmentation ×1