$output = preg_replace("|(/D)(/s+)(/d+)(;)|", "//1,//3;", $output);
I'm trying to replace all alphabetical character followed by one or more whitespace characters (tabs and/or spaces) followed by one or more numerical characters followed by a semicolon with the alphabetical character followed by a comma followed by the numerical digits and then the semicolon.
I'll provide an example:
Start:
hello world 1007;
End:
hello world,1007;