System.Text.RegularExpressions.RegexCharClass.CharInClassRecursive C# (CSharp) Method

CharInClassRecursive() static private method

static private CharInClassRecursive ( char ch, String set, int start ) : bool
ch char
set String
start int
return bool
        internal static bool CharInClassRecursive(char ch, String set, int start) {
            int mySetLength = set[start+SETLENGTH];
            int myCategoryLength = set[start+CATEGORYLENGTH];
            int myEndPosition = start + SETSTART + mySetLength + myCategoryLength;
            
            bool subtracted = false;
            
            if (set.Length > myEndPosition) {
                subtracted = CharInClassRecursive(ch, set, myEndPosition);
            }

            bool b = CharInClassInternal(ch, set, start, mySetLength, myCategoryLength);
            
            // Note that we apply the negation *before* performing the subtraction.  This is because
            // the negation only applies to the first char class, not the entire subtraction. 
            if (set[start+FLAGS] == 1)
                b = !b;

            return b && !subtracted;
        }