$re = '/^(?=.*[BFGJKPQVWXYZ])\w{3}\b/m';
$str = 'THE 53097401461
OF 30966074232
AND 22632024504
TO 19347398077
IN 16891065263
A 15310087895
IS 8384246685
THAT 8000768228
FOR 6545282031
IT 5740085369
AS 5700645258
WAS 5502713968
WITH 5182797249
BE 4818864785
BY 4703106084
ON 4594521081
NOT 4522732626
HE 4110457083
I 3884828634
THIS 3826060334
ARE 3700433333
OR 3667713965
HIS 3611377789
FROM 3469207674
AT 3413452256
WHICH 3140226612
BUT 2792350185
HAVE 2777439117
AN 2726250863
HAD 2616021603
THEY 2462131290
YOU 2337737641
WERE 2270487439
THEIR 2152980325
ONE 2148983086
ALL 2062779102
WE 2057296224';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php