1 2 3 4 5 6 7 8 9
<?php $test = <<<EOF "john" 'likes-cake' "ca,ke" but john doesn't like apples EOF; var_dump( preg_match_all('#(?<!["\']) \b \w+ \b (?!["\'])#', $test, $matches), $matches );
1 2 3 4 5
Warning: preg_match_all(): Internal pcre_fullinfo() error -3 on line 7 bool(false) array(0) { }