Since we don't know what language you're doing it on, and how to handle it, the only portable solution for mass replacement is to do it twice. First run one with \b(\d+)\b
replacing group 1 with 1 + ".0", then run a second time with \.0\.
and replace it all (group 0) with a single dot. While this solution is heavier, it's the simplest and most universal.
The less-portable expression to use is ((\d+)(\.\d+)?)
with conditional processing. Here's a Java example for it:
java.util.regex.Pattern pc = java.util.regex.Pattern.compile("((\\d+)(\\.\\d+)?)");
java.util.regex.Matcher m = pc.matcher("5+10/3-3.0 *(4+8.0)");
StringBuffer sb = new StringBuffer();
while (m.find()) {
m.appendReplacement(sb, m.group(3) == null ? m.group(1) + ".0" : m.group(1));
}
m.appendTail(sb);
System.out.println(sb.toString());
It is also possible to use this expression in PHP with a callback function to do the same.