preg_match_all demo
<? $a = "Foo moo boo tool foo!"; preg_match_all("/[A-Za-z]oo\b/i", $a, $matches); var_dump($myarray); ?>