System.Text.RegularExpressions.RegexReplacement.ReplacementImplRTL C# (CSharp) Method

ReplacementImplRTL() private method

Given a Match, emits into the List the evaluated Right-to-Left substitution pattern.
private ReplacementImplRTL ( List al, Match match ) : void
al List
match Match
return void
        private void ReplacementImplRTL(List<string> al, Match match)
        {
            for (int i = _rules.Count - 1; i >= 0; i--)
            {
                int r = _rules[i];
                if (r >= 0)  // string lookup
                    al.Add(_strings[r]);
                else if (r < -Specials) // group lookup
                    al.Add(match.GroupToStringImpl(-Specials - 1 - r));
                else
                {
                    switch (-Specials - 1 - r)
                    { // special insertion patterns
                        case LeftPortion:
                            al.Add(match.GetLeftSubstring());
                            break;
                        case RightPortion:
                            al.Add(match.GetRightSubstring());
                            break;
                        case LastGroup:
                            al.Add(match.LastGroupToStringImpl());
                            break;
                        case WholeString:
                            al.Add(match.GetOriginalString());
                            break;
                    }
                }
            }
        }