- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.14
- array ( 0 => 'this is a', 1 => ' this', 2 => 'a', 3 => ' b', )
<?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]);