I am trying to split a paragraph of text into its sentences using jquery. However I met with some cases in which the sentences will be split wrongly.
Cases such as below
My answer was 5.6 of the answers were wrong.
Given above case, if there is no space, the two sentences cannot be split.
Currently the way I am doing it is just finding index of the period, which doesnt work. Is there any way to do it using the regex match method?
Thanks in advance!
You can check for
'.'that follow by space. Like this:It will show
se tenc one,se tenc two,se tenc 5.6 one,.Now you can add other sentense ending character like
'!?;'.