Replace all dots in paragraph with new line except that dots between numbers and after Dr., Mr., Bsc. .... etc.
For Example:
Consider this Paragraph
My name is Ayman. I'm 31 years. I'm 1.92M. I have BSc. degree in Computer Engineering
I want to apply such REGEX and convert it as the following:
My name is Ayman.
I'm 31 years.
I'm 1.92M. <===== note the '.' between 1 and 92 did not replace with new line
I have BSc. degree in Computer Engineering <=== the same . after BSc did not replace with new line
I tried the following but this REGEX replace all dots.
$desc['contents']=preg_split("/(?<!\..)([\?\!\.]+)\s(?!.\.)/",$desc['contents'],-1, PREG_SPLIT_DELIM_CAPTURE);