, :
var breakIntoSentences = function(s) {
var l = [];
s.replace(/[^.?]+.?/g, a => l.push(a));
return l;
}
breakIntoSentences("how? who cares.")
["how?", " who cares."]
(, : RE -, -. , - , .)
, breakIntoSentences("how???? who cares...") ["how?", " who cares."]. , /[^.?]+[.?]*/g RE .
: : Wavvves match(), /push. , - .
, ES6, :
const breakIntoSentences = s => s.match(/[^.?,]+[.?,]*/g)