diff --git a/Source/Model/Model.cs b/Source/Model/Model.cs index f07c3a48c..25bec5f69 100644 --- a/Source/Model/Model.cs +++ b/Source/Model/Model.cs @@ -647,7 +647,7 @@ public override string ToString() #region factory methods - Element ConstructElement(string name) + public Element ConstructElement(string name) { if (name.ToLower() == "true") { @@ -699,7 +699,6 @@ Element ConstructElement(string name) } var allDigits = new Regex(@"^-?[0-9]*$"); - var real = new Regex(@"^-?[0-9]+\.[0-9]+$"); if (allDigits.IsMatch(name)) { if (szi > 0) @@ -711,7 +710,7 @@ Element ConstructElement(string name) return new Integer(this, name); } } - else if (real.IsMatch(name)) + else if (double.TryParse(name, out var _)) { return new Real(this, name); } @@ -1077,4 +1076,4 @@ public static List ParseModels(System.IO.TextReader rd, Func