Alsing.Text.PatternMatchers.RangePatternMatcher.Match C# (CSharp) Метод

Match() публичный Метод

public Match ( string textToMatch, int matchAtIndex ) : int
textToMatch string
matchAtIndex int
Результат int
        public override int Match(string textToMatch, int matchAtIndex)
        {
            int length = 0;
            int textLength = textToMatch.Length;

            while (matchAtIndex + length != textLength)
            {
                if (textToMatch[matchAtIndex + length] == EndChar &&
                    (matchAtIndex + length < textLength - 1 && textToMatch[matchAtIndex + length + 1] == EndChar))
                {
                    length++;
                }
                else if (textToMatch[matchAtIndex + length] == EndChar &&
                         (matchAtIndex + length == textLength - 1 || textToMatch[matchAtIndex + length + 1] != EndChar))
                    return length + 1;

                length++;
            }


            return 0;
        }
    }
RangePatternMatcher