language: PHP (php 5.4.4)
date: 603 days 1 hour ago
link:
visibility: public
1
2
3
4
<?php
    $input = "This is another text string. 2.0 times longer.";
    echo preg_replace("/(^\.|\s\.|\.\s|\.$)/", " $1", $input);
?>