$re = '/\b\d{12}\b.+?(?=\b\d{12}\b|$)/m';
$str = 'LOREM IPSUM LOR IPSUM DDDDDDDDD FG SSSSS NUMBER 106/03/2019 LOREMFG OF LOREMIPSUMF LOREM OPFRTE ERTIO LOREMIPS LOREMIOS 05/30/2019 DERTE TH LOREM (LWA LTD)------------------------------------------------------------------------------------------------------------------------------------011111111111 CDGH, LGF ADF : 203 HYT *LOREM IPSUM / LOREM IPSUM* COUNTY : GTYH CHIDGER L. IPSUM THJ. DATE: 07/21/2000 LOREM IPSUM DOLOT & LOREM IPSUM 768 LOREM IPSUM, 67TH LOREM IPSUM IPSUM. DTEA: NIGER, GA 12345 LOREM IPSUM DOLOT 97 LOREM IPSUM DOLOT, KY 35678-8765 011111111111 CDGH, LGF ADF : 203 HYT *LOREM IPSUM / LOREM IPSUM* COUNTY : GTYH CHIDGER L. IPSUM THJ. DATE: 07/21/2000 LOREM IPSUM DOLOT & LOREM IPSUM 768 LOREM IPSUM, 67TH LOREM IPSUM IPSUM. DTEA: NIGER, GA 12345 LOREM IPSUM DOLOT 97 LOREM IPSUM DOLOT, KY 35678-8765 011111111111 CDGH, LGF ADF : 203 HYT *LOREM IPSUM / LOREM IPSUM* COUNTY : GTYH CHIDGER L. IPSUM THJ. DATE: 07/21/2000 LOREM IPSUM DOLOT & LOREM IPSUM 768 LOREM IPSUM, 67TH LOREM IPSUM IPSUM. DTEA: NIGER, GA 12345 LOREM IPSUM DOLOT 97 LOREM IPSUM DOLOT, KY 35678-8765 ';
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