$re = '/^(?:(?:bank routing *)|(?:aba *)|(?:routing *))(?:(?:[\(\)\w #\.]*:)|(?:no: aba no\.)) ([0-9\- ]+)(?:\(for wires only\))*$/im';
$str = 'asd
ABA (ROUTING) NUMBER: 11111
eee
ABA NO.: 22222
sss
ABA Number: 33333
aaaa
ROUTING NUMBER: 44444
qqqq
ROUTING NUMBER: 55-5-55 (FOR WIRES ONLY)
lll
BANK ROUTING NO: ABA NO. 66-666
dddd
ABA ROUTING #: 77 77 7
aaaa
ROUTING NUMBER: 88888
zzzz
ABA (Routing Number): 99-99-9
mmm
ABA #: 1001001
qqq
ABA: 1101101
xxx
ABA Routing Number: 1201201
xxxx
';
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