- var_export: documentation ( source)
- preg_split: documentation ( source)
<?php
$text = <<<TEXT
Dr. Di MacKusa is a doctor. Do you know her?!? She live on 1 Doctor Dr. Doctorsville in the U.S.A. Mr. MacKusa married Dr. Di.
TEXT;
var_export(
preg_split(
'~(?:Ms|Dr|Mrs?|Prof)\.(*SKIP)(*FAIL)|[?!.]+\K\s+~',
$text,
0,
PREG_SPLIT_NO_EMPTY
)
);