$re = '/ *; */m';
$str = 'H;53; ;00 00 35.37;-29 15 48.2;10.96; ;H;000.14739023;-2.926.338.247; ; -1.76; 11.94; -12.96; 2.18; 1.03; 2.45; 3.15; 1.27; 0.03;-0.07; 0.07; 0.27; 0.05; 0.08;-0.10;-0.32; 0.11;-0.22;0; 1.19;53; ; ; ; ; ; ; ; ; ; ;T; ;111.006;0.0041;0.041;152; ;11.03;11.17; ; ; ; ; ; ; ;1; ; ; ; ; ; ; ; ; ; ;G; ; ; ;C-29 18916; ;0.72; ; ';
$subst = ";";
$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