82 writes to _pos
System.Text.RegularExpressions (82)
System\Text\RegularExpressions\RegexParser.cs (82)
75_pos = 0; 235parser._pos = i; 259_pos = 0; 293_pos++; 298_pos++; 312_pos++; 417--_pos; 434ch = _pattern[_pos++]; 463_pos++; 468if (startpos == _pos || _pos == _pattern.Length || _pattern[_pos++] != '}') 472_pos = startpos - 1; 488_pos++; 527_pos = _pattern.IndexOf('$', _pos); 530_pos = _pattern.Length; 537_pos++; 566_pos++; 586_pos++; 603ch = _pattern[_pos++]; 639switch (ch = _pattern[_pos++]) 717--_pos; 757_pos++; 763_pos++; 814_pos++; 825char ch = _pattern[_pos++]; 860switch (ch = _pattern[_pos++]) 885--_pos; 941_pos++; 982if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 1002if (_pos < _pattern.Length && _pattern[_pos++] == ')') 1018if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 1026_pos = parenPos - 1; // jump to the start of the parentheses 1047--_pos; 1061if ((ch = _pattern[_pos++]) == ')') 1092_pos++; 1098_pos = _pattern.IndexOf('\n', _pos); 1101_pos = _pattern.Length; 1106_pos = _pattern.IndexOf(')', _pos); 1109_pos = _pattern.Length; 1113_pos++; 1136_pos++; 1141_pos++; 1146_pos++; 1151_pos++; 1156_pos++; 1161_pos++; 1166_pos++; 1172_pos++; 1213_pos++; 1214ch = _pattern[_pos++]; 1236_pos++; 1246if (_pos < _pattern.Length && _pattern[_pos++] == close) 1271_pos++; 1312if (_pos < _pattern.Length && _pattern[_pos++] == close) 1323_pos = backpos; 1349_pos++; 1365_pos++; 1382_pos++; 1389_pos = lastEndPos; 1398if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1410if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1425_pos++; 1451_pos++; 1458_pos = backpos; 1469if (!RegexCharClass.IsBoundaryWordChar(_pattern[_pos++])) 1471--_pos; 1488_pos++; 1511_pos++; 1533char ch = _pattern[_pos++]; 1560char ch = _pattern[_pos++]; 1580for (bool off = false; _pos < _pattern.Length; _pos++) 1623char ch = _pattern[_pos++]; 1627--_pos; 1672char ch = _pattern[_pos++]; 1681ch = _pattern[_pos++]; 1684--_pos; 1691if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1724char ch = _pattern[_pos++]; 1737--_pos; 1757--_pos; 1766_pos++; 1772_pos++; 1800_pos++;
156 references to _pos
System.Text.RegularExpressions (156)
System\Text\RegularExpressions\RegexParser.cs (156)
241i = parser._pos; 279while (_pos < _pattern.Length) 286int startpos = _pos; 292while (_pos < _pattern.Length && (!IsSpecialOrSpace(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 297while (_pos < _pattern.Length && (!IsSpecial(ch = _pattern[_pos]) || (ch == '{' && !IsTrueQuantifier()))) 301int endpos = _pos; 305if (_pos == _pattern.Length) 309else if (IsSpecial(ch = _pattern[_pos])) 385if (_pos == _pattern.Length) 427if (_pos == _pattern.Length || !(isQuantifier = IsTrueQuantifier())) 457startpos = _pos; 459if (startpos < _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) 525int startpos = _pos; 527_pos = _pattern.IndexOf('$', _pos); 528if (_pos < 0) 533AddToConcatenate(startpos, _pos - startpos, isReplacement: true); 535if (_pos < _pattern.Length) 564if (_pos < _pattern.Length && _pattern[_pos] == '^') 571if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 577for (; _pos < _pattern.Length; firstChar = false) 584if (_pos < _pattern.Length && _pattern[_pos] == '^') 591if ((_options & RegexOptions.ECMAScript) != 0 && _pos < _pattern.Length && _pattern[_pos] == ']') 596if (_pos >= _pattern.Length) 624if (_pos < _pattern.Length && _pattern[_pos] != ']') 637else if (ch == '\\' && _pos < _pattern.Length) 649charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern, _pos); 687charClass!.AddCategoryFromName(ParseProperty(), ch != 'p', caseInsensitive, _pattern, _pos); 752else if (_pos + 1 < _pattern.Length && _pattern[_pos] == '-' && _pattern[_pos + 1] != ']') 759else if (_pos < _pattern.Length && ch == '-' && !translatedChar && _pattern[_pos] == '[' && !firstChar) 801if (_pos == _pattern.Length || _pattern[_pos] != '?' || (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == ')')) 818if (_pos == _pattern.Length) 855if (_pos == _pattern.Length) 902if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 922if (_pos < _pattern.Length && !(_pattern[_pos] == close || _pattern[_pos] == '-')) 939if ((capnum != -1 || proceed) && _pos + 1 < _pattern.Length && _pattern[_pos] == '-') 942ch = _pattern[_pos]; 954if (_pos < _pattern.Length && _pattern[_pos] != close) 968if (_pos < _pattern.Length && _pattern[_pos] != close) 982if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[_pos++] == close) 993int parenPos = _pos; 994if (_pos < _pattern.Length) 996ch = _pattern[_pos]; 1002if (_pos < _pattern.Length && _pattern[_pos++] == ')') 1018if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[_pos++] == ')') 1029if (_pos + 2 < _pattern.Length && _pattern[_pos + 1] == '?') 1032if (_pattern[_pos + 2] == '#') 1038if (_pattern[_pos + 2] == '\'' || (_pos + 3 < _pattern.Length && _pattern[_pos + 2] == '<' && _pattern[_pos + 3] != '!' && _pattern[_pos + 3] != '=')) 1056if (_pos == _pattern.Length) 1090while (_pos < _pattern.Length && IsSpace(_pattern[_pos])) 1096if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1098_pos = _pattern.IndexOf('\n', _pos); 1099if (_pos < 0) 1104else if (_pos + 2 < _pattern.Length && _pattern[_pos + 2] == '#' && _pattern[_pos + 1] == '?' && _pattern[_pos] == '(') 1106_pos = _pattern.IndexOf(')', _pos); 1107if (_pos < 0) 1125Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1128switch (ch = _pattern[_pos]) 1179cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern, _pos); 1200Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1202int backpos = _pos; 1205char ch = _pattern[_pos]; 1211if (_pos + 1 < _pattern.Length) 1222if (!angled || _pos == _pattern.Length) 1227ch = _pattern[_pos]; 1232else if ((ch == '<' || ch == '\'') && _pos + 1 < _pattern.Length) 1237ch = _pattern[_pos]; 1246if (_pos < _pattern.Length && _pattern[_pos++] == close) 1263int pos = _pos - 1; 1272if (_pos == _pattern.Length || (ch = _pattern[_pos]) < '0' || ch > '9') 1312if (_pos < _pattern.Length && _pattern[_pos++] == close) 1334if (_pos == _pattern.Length) 1339char ch = _pattern[_pos]; 1341int backpos = _pos; 1346if (ch == '{' && _pos + 1 < _pattern.Length) 1350ch = _pattern[_pos]; 1369lastEndPos = _pos; 1372while (_pos < _pattern.Length && (ch = _pattern[_pos]) >= '0' && ch <= '9') 1386lastEndPos = _pos; 1398if (!angled || _pos < _pattern.Length && _pattern[_pos++] == '}') 1410if (_pos < _pattern.Length && _pattern[_pos++] == '}') 1465int startpos = _pos; 1467while (_pos < _pattern.Length) 1476return _pattern.Substring(startpos, _pos - startpos); 1483int c = Math.Min(3, _pattern.Length - _pos); 1486for (i = 0; c > 0 && (uint)(d = _pattern[_pos] - '0') <= 7; c -= 1) 1509while (_pos < _pattern.Length && (uint)(d = (char)(_pattern[_pos] - '0')) <= 9) 1529if (_pos + c <= _pattern.Length) 1555if (_pos == _pattern.Length) 1580for (bool off = false; _pos < _pattern.Length; _pos++) 1582char ch = _pattern[_pos]; 1667if (_pos + 2 >= _pattern.Length) 1678int startpos = _pos; 1679while (_pos < _pattern.Length) 1689string capname = _pattern.Substring(startpos, _pos - startpos); 1691if (_pos == _pattern.Length || _pattern[_pos++] != '}') 1721while (_pos < _pattern.Length) 1723int pos = _pos; 1728if (_pos < _pattern.Length) 1754if (_pos + 1 < _pattern.Length && _pattern[_pos + 1] == '#' && _pattern[_pos] == '?') 1763if (_pos < _pattern.Length && _pattern[_pos] == '?') 1768if (_pos + 1 < _pattern.Length && (_pattern[_pos] == '<' || _pattern[_pos] == '\'')) 1773ch = _pattern[_pos]; 1795if (_pos < _pattern.Length) 1797if (_pattern[_pos] == ')') 1803else if (_pattern[_pos] == '(') 2005Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 2007int startpos = _pos; 2015int nChars = _pattern.Length - _pos; 2141new RegexParseException(error, _pos, SR.Format(SR.MakeException, _pattern, _pos, message));