Better use of regex to replace milliseconds