$re = '/\bDELIVER TO:\R\h*(\S+).*(?:\R.*){2}.*\h(\S+)/';
$str = 'RECOVER FROM:
LUFTHANSA CARGO - FRA
FLIGHT: LH441
ETA: SUN 25-APR-2021 09:09
WAYBILL: 020-90350573
ORIGIN: IAH
SERVICE: ZXO Courier Solution
x0Wx0H in. 109 lbs (49.0 kg) Skid
DELIVER TO:
VITESCO TECHNOLOGIES CZECH REPUBLIC S.R.O
VOLANOVSKA 518
TRUTNOV 541 01 CZ
ATTN: ADAM STUCHLIK
PHONE: +420 731 593 139
EST. DISTANCE: 293 miles
PCS/WT: 1 / 49.0 kg (109 lbs)
DIMS: 1@82x82x51cm
ORDER#: 10659800
CONTENTS: PCV PANNEL
SERVICE: Next Flight Out(NFO)
URGENT! PLEASE CONFIRM THIS ALERT BY EMAILING CnwGermanyOps@cnwglobal.com OR CALLING COURIER NETWORK INC. AT 800-852-2282';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 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