????????????????????????????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??????????????????“???????????????????????”

????????娌�????????????