3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/^.{0,11}\S(?!\S)/m'; $str = 'this is a test sentence this is a test sentence a b c'; preg_match_all($re, $str, $matches); var_export($matches[0]);

preferences:
45.68 ms | 405 KiB | 5 Q