Split string into sentences in javascript

后端 未结 8 1179
悲哀的现实
悲哀的现实 2020-11-29 06:08

Currently i am working on an application that splits a long column into short ones. For that i split the entire text into words, but at the moment my regex splits numbers to

8条回答
  •  被撕碎了的回忆
    2020-11-29 06:48

    I would just change the strings and put something between each sentence. You told me you have the right to change them so it will be easier to do it this way.

    \r\n
    

    By doing this you have a string to search for and you won't need to use these complex regex.

    If you want to do it the harder way I would use a regex to look for "." "?" "!" folowed by a capital letter. Like Tessi showed you.

提交回复
热议问题