I have this regex:
$text = preg_replace_callback('/(d+.d+|b[A-Z](?:.[A-Z])*b.?)|([.,;:!?)])s*/', function ($matches) {
return $matches[1] ? $matches[1] : $matches[2] . ' ';
}, $text);
Which targets the end of sentences and avoids abbreviations like N.B.C.
It works fine. The problem is that it doesn’t detect tree dots ... or the ellipsis symbol … as the end of the sentence.
How can I adjust the regex to include it as well?