1 write to _pattern
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexParser.cs (1)
60_pattern = pattern;
168 references to _pattern
System.Text.RegularExpressions (168)
System\Text\RegularExpressions\RegexParser.cs (168)
279while (_pos < _pattern.Length) 292while (_pos < _pattern.Length && (!IsSpecialOrSpace(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 297while (_pos < _pattern.Length && (!IsSpecial(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 305if (_pos == _pattern.Length) 309else if (IsSpecial(ch = _pattern[_pos])) 332_unit = RegexNode.CreateOneWithCaseConversion(_pattern[endpos - 1], _options, _culture, ref _caseBehavior); 385if (_pos == _pattern.Length) 450if (_pos == _pattern.Length || !(isQuantifier = IsTrueQuantifier())) 457ch = _pattern[_pos++]; 484if (_pos < _pattern.Length && _pattern[_pos] == ',') 487max = _pos == _pattern.Length || _pattern[_pos] == '}' ? int.MaxValue : ScanDecimal(); 491if (startpos == _pos || _pos == _pattern.Length || _pattern[_pos++] != '}') 509if (_pos < _pattern.Length && _pattern[_pos] == '?') 546while (_pos < _pattern.Length) 550_pos = _pattern.IndexOf('$', _pos); 553_pos = _pattern.Length; 558if (_pos < _pattern.Length) 587if (_pos < _pattern.Length && _pattern[_pos] == '^') 594if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 600for (; _pos < _pattern.Length; firstChar = false) 607if (_pos < _pattern.Length && _pattern[_pos] == '^') 614if ((_options & RegexOptions.ECMAScript) != 0 && _pos < _pattern.Length && _pattern[_pos] == ']') 619if (_pos >= _pattern.Length) 626ch = _pattern[_pos++]; 647if (_pos < _pattern.Length && _pattern[_pos] != ']') 660else if (ch == '\\' && _pos < _pattern.Length) 662switch (ch = _pattern[_pos++]) 672charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern, _pos); 710charClass!.AddCategoryFromName(ParseProperty(), ch != 'p', caseInsensitive, _pattern, _pos); 775else if (_pos + 1 < _pattern.Length && _pattern[_pos] == '-' && _pattern[_pos + 1] != ']') 782else if (_pos < _pattern.Length && ch == '-' && !translatedChar && _pattern[_pos] == '[' && !firstChar) 824if (_pos == _pattern.Length || _pattern[_pos] != '?' || (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == ')')) 841if (_pos == _pattern.Length) 848char ch = _pattern[_pos++]; 878if (_pos == _pattern.Length) 883switch (ch = _pattern[_pos++]) 925if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 945if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 962if ((capnum != -1 || proceed) && _pos + 1 < _pattern.Length && _pattern[_pos] == '-') 965ch = _pattern[_pos]; 977if (_pos < _pattern.Length && _pattern[_pos] != close) 991if (_pos < _pattern.Length && _pattern[_pos] != close) 1005if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 1017if (_pos < _pattern.Length) 1019ch = _pattern[_pos]; 1025if (_pos < _pattern.Length && _pattern[_pos++] == ')') 1041if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 1052if (_pos + 2 < _pattern.Length && _pattern[_pos + 1] == '?') 1055if (_pattern[_pos + 2] == '#') 1061if (_pattern[_pos + 2] == '\'' || (_pos + 3 < _pattern.Length && _pattern[_pos + 2] == '<' && _pattern[_pos + 3] != '!' && _pattern[_pos + 3] != '=')) 1080if (_pos == _pattern.Length) 1085if ((ch = _pattern[_pos++]) == ')') 1114while (_pos < _pattern.Length && IsSpace(_pattern[_pos])) 1120if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1122_pos = _pattern.IndexOf('\n', _pos); 1125_pos = _pattern.Length; 1128else if (_pos + 2 < _pattern.Length && _pattern[_pos + 2] == '#' && _pattern[_pos + 1] == '?' && _pattern[_pos] == '(') 1130_pos = _pattern.IndexOf(')', _pos); 1133_pos = _pattern.Length; 1149Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1152switch (ch = _pattern[_pos]) 1207cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern, _pos); 1228Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1233char ch = _pattern[_pos]; 1239if (_pos + 1 < _pattern.Length) 1242ch = _pattern[_pos++]; 1250if (!angled || _pos == _pattern.Length) 1255ch = _pattern[_pos]; 1260else if ((ch == '<' || ch == '\'') && _pos + 1 < _pattern.Length) 1265ch = _pattern[_pos]; 1274if (_pos < _pattern.Length && _pattern[_pos++] == close) 1300if (_pos == _pattern.Length || (ch = _pattern[_pos]) < '0' || ch > '9') 1340if (_pos < _pattern.Length && _pattern[_pos++] == close) 1362if (_pos == _pattern.Length) 1367char ch = _pattern[_pos]; 1374if (ch == '{' && _pos + 1 < _pattern.Length) 1378ch = _pattern[_pos]; 1400while (_pos < _pattern.Length && (ch = _pattern[_pos]) >= '0' && ch <= '9') 1426if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1438if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1495while (_pos < _pattern.Length) 1497if (!RegexCharClass.IsBoundaryWordChar(_pattern[_pos++])) 1504return _pattern.Substring(startpos, _pos - startpos); 1511int c = Math.Min(3, _pattern.Length - _pos); 1514for (i = 0; c > 0 && (uint)(d = _pattern[_pos] - '0') <= 7; c -= 1) 1537while (_pos < _pattern.Length && (uint)(d = (char)(_pattern[_pos] - '0')) <= 9) 1557if (_pos + c <= _pattern.Length) 1561char ch = _pattern[_pos++]; 1583if (_pos == _pattern.Length) 1588char ch = _pattern[_pos++]; 1608for (bool off = false; _pos < _pattern.Length; _pos++) 1610char ch = _pattern[_pos]; 1651char ch = _pattern[_pos++]; 1695if (_pos + 2 >= _pattern.Length) 1700char ch = _pattern[_pos++]; 1707while (_pos < _pattern.Length) 1709ch = _pattern[_pos++]; 1717string capname = _pattern.Substring(startpos, _pos - startpos); 1719if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1868while (_pos < _pattern.Length) 1871char ch = _pattern[_pos++]; 1875if (_pos < _pattern.Length) 1901if (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == '#' && _pattern[_pos] == '?') 1910if (_pos < _pattern.Length && _pattern[_pos] == '?') 1915if (_pos + 1 < _pattern.Length && (_pattern[_pos] == '<' || _pattern[_pos] == '\'')) 1920ch = _pattern[_pos]; 1942if (_pos < _pattern.Length) 1944if (_pattern[_pos] == ')') 1950else if (_pattern[_pos] == '(') 2152Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 2155char ch = _pattern[startpos]; 2162int nChars = _pattern.Length - _pos; 2163while (--nChars > 0 && (uint)((ch = _pattern[++pos]) - '0') <= 9) ; 2180while (--nChars > 0 && (uint)((ch = _pattern[++pos]) - '0') <= 9) ; 2194_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior)); 2197case > 1 when (_options & RegexOptions.IgnoreCase) == 0 || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(_pattern.AsSpan(pos, cch)): 2198_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch))); 2202foreach (char c in _pattern.AsSpan(pos, cch)) 2288new RegexParseException(error, _pos, SR.Format(SR.MakeException, _pattern, _pos, message));