$re = '/(?(DEFINE) # Construct a definition structure
(?<punc>[!?.]+) # Define `punc` group consisting of `.`, `?` and `!`
) # End of definition
\b # Match a word boundary position
(?> # Open a grouping (non-capturing) (a)
[a-z0-9] # Match a digit or a lower case letter
\w* # And any number of word characters
| # Or
[A-Z] # Match a upper case letter
\w{3,} # And word characters more than 3
(?= # Followed by
(?&punc) # Any number of `.`, `?` and `!` characters
) # End of positive lookahead
) # End of grouping (a)
(?&punc) # Match any number of `.`, `?` and `!` characters
\K\B\s* # Reset match, assert a NWB position + any number of whitespaces/x';
$str = 'Fame came to Gama at the age of 17 when he challenged then-Indian Wrestling Champion, middle-aged Raheem Bakhsh Sultani Wala, another Muslim wrestler from Gujranwala, now in Punjab, Pakistan. At about 7 feet tall, with a very impressive win-loss record, Raheem was expected to easily defeat the 5\'7" G. Raheem\'s only drawback was his age as he was much older than Gama, and near the end of his career. The bout continued for hours and eventually ended in a draw. The contest with Raheem was the turning point in Gama\'s career. After that, he was looked upon as the next contender for the Indian Wrestling Championship. In the first bout Gama remained defensive, but in the second bout, Gama went on the offensive. Despite severe bleeding from his nose and ears, he managed to deal out a great deal of damage to Raheem Bakhsh. By 1910, Gama had defeated all the prominent Indian wrestlers who faced him except the champion, Raheem Bakhsh Sultani Wala. At this time, he focused his attention on the rest of the world. Accompanied by his younger brother Imam Bakhsh, Gama sailed to England to compete with the Western Wrestlers but could not gain instant entry, because of his lower height.[6]
In London, Gama issued a challenge that he could throw any three wrestlers in thirty minutes of any weight class. This announcement however was seen as a bluff by the wrestlers and their wrestling promoter R. B. Benjamin. For a long time no one came forward to accept the challenge. To break the ice, Gama presented another challenge to specific heavy weight wrestlers. He challenged Stanislaus Zbyszko and Frank Gotch, either he would beat them or pay them the prize money and go home. The first professional wrestler to take his challenge was the American Benjamin Roller. In the bout, Gama pinned Roller in 1 minute 40 seconds the first time, and in 9 minutes 10 seconds the other. On the second day, he defeated 12 wrestlers and thus gained entry to official tournament.';
$subst = "\n\n";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php