$re = '/(.*Device:\s*(.*?)\s*Serial Number.*)|(.*Gerät:\s*(.*?)\s*Seriennummer.*)|(.*ICD-Model:\s*(.*?)\s*Serial Number:.*)|(.*ICD-Modell:\s*(.*?)\s*Seriennummer.*)|(.*Pacemaker Model:\s*(.*?)\s*Serial Number.*)|(.*Schrittmachermodell:\s*(.*?)\s*Seriennummer:.*)/m';
$str = 'Device:REVEAL LINQ LNQ11 Serial Number:RLA087267G Date of Visit:03-Jul-2019 08:10:51
Gerät:Viva Quad XT CRT-D DTBA2QQ Seriennummer:BLG613658S Untersuchungsdatum:27-Apr-2018 12:34:06
ICD-Modell: Marquis VR 7230 Seriennummer: PKD616419S Untersuchungsdatum:12, Mai 2015
ICD-Model: Marquis VR 7230 Serial Number: PKD616419S Untersuchungsdatum:12, Mai 2015
Pacemaker Model: Medtronic Adapta ADSR01 Serial Number: NWM851790 Date of Visit: 12/08/17
Schrittmachermodell: Medtronic Adapta ADVDD01 Seriennummer: NWG618042 Nachsorgedatum: 05.12.1';
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