$re = '/(?=Table \d+\.)/m';
$str = '4 BLABLA\\r\\n Table 1. Real GDP\\r\\n Percentage changes\\r\\n 2016 2017 \\r\\nArgentina -2.5 2.7\\r\\nAustralia 2.6 2.5\\r\\n BLABLA \\r\\n Table 2. Nominal GDP\\r\\n Percentage changes\\r\\n 2011 2012\\r\\nArgentina 31.1 21.1\\r\\nAustralia 7.7 3.3\\r\\n';
$subst = "\n\n\n";
$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