3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(?:\|\h*|\G(?!^))([^.\r\n]+)\.\h*/'; $str = '| This is one. This is two. John loves Mary.| This is one. This is two.'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); print_r($matches);

preferences:
42.96 ms | 1551 KiB | 5 Q