I want to return matches for every instance of a three word phrase. I'm not worried about proper grammar right now. I'm more interested in how to achieve the 'multi-pass' nature of the request.
$string = "one two three four five";
$regex = '/(?:[^\\s\\.]+\\s){3}/ui';
preg_match_all($regex, $string, $matches);
Will only return:
one two three
Needed results:
one two three
two three four
three four five