$re = '/(?<!\w\.\w.|etc.)(?<=\.|\?|!)\s(?=\w)/m';
$str = ' At present, I believe the "deeply-involved" contributor would need to fork the \'content\' repo to their personal Github accounts, revise, and later do pull requests. An alternative workflow was considered that might involve more sophisticated use of Github, but after piloting it out, this seemed like it would be hard to explain and enforce consistent use, esp. with github newbies. This was overkill; though this project may contain very modest amounts of code, it is not a coding project for a software product! I decided that this is best left to user\'s individual workflow. Some explanation of best practice, etc. this is a test. (e.g. for pull requests) might still be needed for the proposed workflow, but this is a lighter burden than the alternative
This is a ttest.
This is a test. this is another test
This is a ttest.
This is a test. this is another test';
$subst = "\r";
$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