$re = '/\.[A-Za-z]+\.\d+/m';
$str = 'aaa/prt001.prt.1
aaa/prt001.prt.2
aaa/prt001.prt.3
aaa/prt001.prt.4
aaa/prt001.prt.5
aaa/prt001.prt.10
aaa/prt001.asm.1
aaa/prt001.asm.2
aaa/prt001.asm.3
aaa/prt001.txt.10
aaa/prt001.txt.20
aaa/prt001.txt.30
bbb/prt001.prt
bb/prt.001.prt
bb/prt.001.prt.1
bb/prt.001.1
bb/prt.ppp.prt';
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