I am trying to split a string into sentences with preg_split, but I would like it to not split initials.
Examples:
Mark H. Doolittle is my name. What is yours. ( I don't want it to split the middle initial, but want to split after 'name')
The company is is called H.R. Block. They are a good company. ( I don't want it to split after 'H', 'R')
Here is the code i have, but it causes a split at every period. can someone help me out, im not good a regex yet.
[PHP]$sentences = preg_split ("/[.?!]+/", $data);[/PHP]
Examples:
Mark H. Doolittle is my name. What is yours. ( I don't want it to split the middle initial, but want to split after 'name')
The company is is called H.R. Block. They are a good company. ( I don't want it to split after 'H', 'R')
Here is the code i have, but it causes a split at every period. can someone help me out, im not good a regex yet.
[PHP]$sentences = preg_split ("/[.?!]+/", $data);[/PHP]
Comment