i.e., "10 PPM", "-+10 PPM", "5 DA", "±10 MMU", etc...
public Tolerance(string s) { Match m = StringRegex.Match(s); if (!m.Success) throw new ArgumentException("Input string is not in the correct format: " + s); Type = m.Groups[1].Success ? ToleranceType.PlusAndMinus : ToleranceType.FullWidth; Value = double.Parse(m.Groups[2].Value, CultureInfo.CurrentCulture); ToleranceUnit type; Enum.TryParse(m.Groups[3].Value, true, out type); Unit = type; }