$re = '/(\|)\R(?!\|[ \t]+\d+[ \t]+\|)/m';
$str = '| 1020941333 | 569|SP |500000343 | 9|18.05.2011|15:27:00|18.05.2011|
18.05.2011|Y-0444871-ENCR | 1,93 |BRL |8000800000 |
Juros, Comissões e T | | |
| | | |
|CLB082902 | | | |COEL |COEL |
Y-0444871 |
| 1020941586 | 43|SP |500000344 |43|18.05.2011|15:41:43|18.05.2011|
18.05.2011|B-0447039-ENCR | 9,02 |BRL |8000800000 |
Juros, Comissões e T | | |
| | | |
|CLB082902 | | | |COEL |COEL |
B-0447039 |';
$subst = "$1";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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