public static object ParseTypes(string rvalue) { if (List.IsMatch(rvalue)) { return(new List <Val>()); } if (Integer.IsMatch(rvalue)) { return(int.Parse(Integer.Match(rvalue).Groups["value"].ToString())); } if (Double.IsMatch(rvalue)) { return(double.Parse(Double.Match(rvalue).Groups["value"].ToString(), CultureInfo.InvariantCulture)); } if (Str.IsMatch(rvalue)) { return(Str.Match(rvalue).Groups["value"].ToString()); } if (Bool.IsMatch(rvalue)) { return(Bool.Match(rvalue).Groups["value"].ToString() == "True"); } return(null); }