public static string ReplaceDouble([CanBeNull] string s, double value) {
if (s == null) {
return null;
}
if (_parseDouble == null) {
_parseDouble = new Regex(@"-? *\d+([\.,]\d*)?");
}
var match = _parseDouble.Match(s);
if (!match.Success) return s;
return s.Substring(0, match.Index) + value.ToString(CultureInfo.InvariantCulture) +
s.Substring(match.Index + match.Length);
}