First Sentence Regex

前端 未结 7 2083
遇见更好的自我
遇见更好的自我 2021-01-20 03:54

I\'m after a regex ( php / perl compatible ) to get the first sentence out of some text. I realize this could get huge if covering every case, but just after something that

7条回答
  •  庸人自扰
    2021-01-20 04:28

    It isn't just a regex, but I wrote a Python function to do this: Separating sentences. Natural language processing is notoriously difficult, so there are cases this doesn't treat right, but it does handle some tricky cases well.

提交回复
热议问题