$re = '/TRN.*FRLPD\s+FRPLY.*\s*FRLPD\/([\w\s]*).*FRPLY\/([\w\s]*)\//im';
$str = '1.TORNEAMPLE/ERIC
2 HHL RT HK1 LYS IN23NOV OUT26NOV PAST
3 TRN 2C 87 6609 AF 31DEC 1 FRPLY FRLPD HK PAST *
4 TRN 2C 87 6628 AF 01JAN 4 FRLPD FRPLY HK1 1800 2007
FRLPD/LYON PART DIEU//FRPLY/PARIS GARE LYON /TGD *
5 MIS 1A HK1 PAR 23MAY-ARCHIVAGES
6 AP 04.74.07.68.39';
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