1 write to _pattern
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexParser.cs (1)
60_pattern = pattern;
165 references to _pattern
System.Text.RegularExpressions (165)
System\Text\RegularExpressions\RegexParser.cs (165)
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) 427if (_pos == _pattern.Length || !(isQuantifier = IsTrueQuantifier())) 434ch = _pattern[_pos++]; 461if (_pos < _pattern.Length && _pattern[_pos] == ',') 464max = _pos == _pattern.Length || _pattern[_pos] == '}' ? int.MaxValue : ScanDecimal(); 468if (startpos == _pos || _pos == _pattern.Length || _pattern[_pos++] != '}') 486if (_pos < _pattern.Length && _pattern[_pos] == '?') 523while (_pos < _pattern.Length) 527_pos = _pattern.IndexOf('$', _pos); 530_pos = _pattern.Length; 535if (_pos < _pattern.Length) 557if (_pos < _pattern.Length && _pattern[_pos] == '^') 564if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 570for (; _pos < _pattern.Length; firstChar = false) 573ch = _pattern[_pos++]; 582else if (ch == '\\' && _pos < _pattern.Length) 584switch (ch = _pattern[_pos++]) 594charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern, _pos); 632charClass!.AddCategoryFromName(ParseProperty(), ch != 'p', caseInsensitive, _pattern, _pos); 682if (_pos < _pattern.Length && _pattern[_pos] != ']') 698else if (_pos + 1 < _pattern.Length && _pattern[_pos] == '-' && _pattern[_pos + 1] != ']') 705else if (_pos < _pattern.Length && ch == '-' && !translatedChar && _pattern[_pos] == '[' && !firstChar) 715if (_pos < _pattern.Length && _pattern[_pos] != ']') 754if (_pos == _pattern.Length || _pattern[_pos] != '?' || (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == ')')) 771if (_pos == _pattern.Length) 778char ch = _pattern[_pos++]; 808if (_pos == _pattern.Length) 813switch (ch = _pattern[_pos++]) 855if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 875if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 892if ((capnum != -1 || proceed) && _pos + 1 < _pattern.Length && _pattern[_pos] == '-') 895ch = _pattern[_pos]; 907if (_pos < _pattern.Length && _pattern[_pos] != close) 921if (_pos < _pattern.Length && _pattern[_pos] != close) 935if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 947if (_pos < _pattern.Length) 949ch = _pattern[_pos]; 955if (_pos < _pattern.Length && _pattern[_pos++] == ')') 971if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 982if (_pos + 2 < _pattern.Length && _pattern[_pos + 1] == '?') 985if (_pattern[_pos + 2] == '#') 991if (_pattern[_pos + 2] == '\'' || (_pos + 3 < _pattern.Length && _pattern[_pos + 2] == '<' && _pattern[_pos + 3] != '!' && _pattern[_pos + 3] != '=')) 1009if (_pos == _pattern.Length) 1014if ((ch = _pattern[_pos++]) == ')') 1043while (_pos < _pattern.Length && IsSpace(_pattern[_pos])) 1049if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1051_pos = _pattern.IndexOf('\n', _pos); 1054_pos = _pattern.Length; 1057else if (_pos + 2 < _pattern.Length && _pattern[_pos + 2] == '#' && _pattern[_pos + 1] == '?' && _pattern[_pos] == '(') 1059_pos = _pattern.IndexOf(')', _pos); 1062_pos = _pattern.Length; 1078Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1081switch (ch = _pattern[_pos]) 1132cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern, _pos); 1153Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1158char ch = _pattern[_pos]; 1164if (_pos + 1 < _pattern.Length) 1167ch = _pattern[_pos++]; 1175if (!angled || _pos == _pattern.Length) 1180ch = _pattern[_pos]; 1185else if ((ch == '<' || ch == '\'') && _pos + 1 < _pattern.Length) 1190ch = _pattern[_pos]; 1199if (_pos < _pattern.Length && _pattern[_pos++] == close) 1225if (_pos == _pattern.Length || (ch = _pattern[_pos]) < '0' || ch > '9') 1265if (_pos < _pattern.Length && _pattern[_pos++] == close) 1287if (_pos == _pattern.Length) 1292char ch = _pattern[_pos]; 1299if (ch == '{' && _pos + 1 < _pattern.Length) 1303ch = _pattern[_pos]; 1325while (_pos < _pattern.Length && (ch = _pattern[_pos]) >= '0' && ch <= '9') 1351if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1363if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1420while (_pos < _pattern.Length) 1422if (!RegexCharClass.IsBoundaryWordChar(_pattern[_pos++])) 1429return _pattern.Substring(startpos, _pos - startpos); 1436int c = Math.Min(3, _pattern.Length - _pos); 1439for (i = 0; c > 0 && (uint)(d = _pattern[_pos] - '0') <= 7; c -= 1) 1462while (_pos < _pattern.Length && (uint)(d = (char)(_pattern[_pos] - '0')) <= 9) 1482if (_pos + c <= _pattern.Length) 1486char ch = _pattern[_pos++]; 1508if (_pos == _pattern.Length) 1513char ch = _pattern[_pos++]; 1533for (bool off = false; _pos < _pattern.Length; _pos++) 1535char ch = _pattern[_pos]; 1576char ch = _pattern[_pos++]; 1620if (_pos + 2 >= _pattern.Length) 1625char ch = _pattern[_pos++]; 1632while (_pos < _pattern.Length) 1634ch = _pattern[_pos++]; 1642string capname = _pattern.Substring(startpos, _pos - startpos); 1644if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1674while (_pos < _pattern.Length) 1677char ch = _pattern[_pos++]; 1681if (_pos < _pattern.Length) 1707if (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == '#' && _pattern[_pos] == '?') 1716if (_pos < _pattern.Length && _pattern[_pos] == '?') 1721if (_pos + 1 < _pattern.Length && (_pattern[_pos] == '<' || _pattern[_pos] == '\'')) 1726ch = _pattern[_pos]; 1748if (_pos < _pattern.Length) 1750if (_pattern[_pos] == ')') 1756else if (_pattern[_pos] == '(') 1976Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1979char ch = _pattern[startpos]; 1986int nChars = _pattern.Length - _pos; 1987while (--nChars > 0 && (uint)((ch = _pattern[++pos]) - '0') <= 9) ; 2004while (--nChars > 0 && (uint)((ch = _pattern[++pos]) - '0') <= 9) ; 2018_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior)); 2021case > 1 when (_options & RegexOptions.IgnoreCase) == 0 || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(_pattern.AsSpan(pos, cch)): 2022_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch))); 2026foreach (char c in _pattern.AsSpan(pos, cch)) 2112new RegexParseException(error, _pos, SR.Format(SR.MakeException, _pattern, _pos, message));