This should start you off with some basic regular expressions. You should keep re-testing the validness of the Regex and tweak it when you encounter exceptional cases. You can't realy guard against anything (like silkfire stated in the comment on your question).
<?php
$string = "A great way to start with your theme is to use the XML export file from the demo. Having this starting content makes it easier to see how some features are created. Download the demo content below and import it into your WordPress site to get a replica of the theme demo site.The second step is to navigate to the Tools options and click Import. Then on the bottom of the list.";
$result = preg_match_all("/(?:\w+\s)+(?:\w+\.\s|\w+\.[a-z](?:\w+\s)+(?:\w+\.)+)/", $string, $matches);
echo '<pre>';
print_r($matches);
echo '</pre>';
?>
The problem is with your String that you never really know what "lastword.Wordofnewline" is in code-logic. The regex above is actually a same inside itself. This will only match one of the cases tho, like this string where replica
becomes repli.ca
:
A great way to start with your theme is to use the XML export file
from the demo. Having this starting content makes it easier to see how
some features are created. Download the demo content below and import
it into your WordPress site to get a repli.ca of the theme demo
site.The second step is to navigate to the Tools options and click
Import. Then on the bottom of the list.
You really have to customize the regex based on a lot of testing before you can get it to work. If possible (and if that is the case) you should let your users (the writers) validate the output of your code's automatic edits :).