I am trying to use javascript's split to get the sentences out of a string but keep the delimiter eg !?.
So far I have
sentences = text.split(/[\.!?]/);
which works but does not include the ending punctuation for each sentence (.!?).
Does anyone know of a way to do this?
See Question&Answers more detail:os