????????????????????????????Regex?????????????Matches???????????з????????????????????????.NET??????????????????Match??????????????????????????????????????????????????????????????????????????????滻?

?????????????????????????????????????к??????????????????????????????????????????е?????????????????????粻????????????????????????????????????????????????????????δ????д?????????????????汾?????????

???????????????л??????????????????Groups[0]??????????????????????????????? $B'1????????'??Groups[i]?????? i ????0?????????е? i ???????е??????????????????Σ?????????????????

    private const string FormulaItemPattern = @"$(?<type>[B|G|J])'(?<name>.+?)'";
&nbsp;
    private double EvaluateFormula(string formula)
    {
        foreach (Match match in new Regex(FormulaItemPattern).Matches(formula))
        {

            var item = match.Groups[0].ToString();
            var type = match.Groups["type"].ToString();
            var name = match.Groups["name"].ToString();

            ...
    }

???????????????????????????????????……

????????????????????

????????????????????????в???顣??????????????????? $ ?????????????????????????????????????????? #??????????????????????????e?????????????????

????($B'1????????'+10-$G'??????????'+$J'N-213????')*5

???????????????????

????(#B.'1????????'+10-#G.'??????????'+#J.'N-213????')*5

?????????????????????е??????????????????С???????????????????????????????ü??????????????????????

    private const string FormulaItemPattern = @"#(?<type>[B|G|J]).'(?<name>.+?)'";

???????????????????????????????

?????塢???

???????????У???????????????????????????????????壬?????????????????︴????????????????????????????????????

??????????????????????????????????????????????????????????????????仯?????????????????????????

????????????????

?????У????????????“????????????????????????????????????????????????”

?????????л????????????????????????????????????????????????????ABC/XYZ???????б????????????????

????????string.Split??????????????????“???????????????????????”

????????治????????????