81 writes to _pos
System.Text.RegularExpressions (81)
System\Text\RegularExpressions\RegexParser.cs (81)
75
_pos
= 0;
235
parser.
_pos
= i;
259
_pos
= 0;
293
_pos
++;
298
_pos
++;
312
_pos
++;
417
--
_pos
;
434
ch = _pattern[
_pos
++];
463
_pos
++;
468
if (startpos == _pos || _pos == _pattern.Length || _pattern[
_pos
++] != '}')
472
_pos
= startpos - 1;
488
_pos
++;
527
_pos
= _pattern.IndexOf('$', _pos);
530
_pos
= _pattern.Length;
537
_pos
++;
559
_pos
++;
573
ch = _pattern[
_pos
++];
584
switch (ch = _pattern[
_pos
++])
662
--
_pos
;
703
_pos
++;
709
_pos
++;
767
_pos
++;
778
char ch = _pattern[
_pos
++];
813
switch (ch = _pattern[
_pos
++])
838
--
_pos
;
894
_pos
++;
935
if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[
_pos
++] == close)
955
if (_pos < _pattern.Length && _pattern[
_pos
++] == ')')
971
if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[
_pos
++] == ')')
979
_pos
= parenPos - 1; // jump to the start of the parentheses
1000
--
_pos
;
1014
if ((ch = _pattern[
_pos
++]) == ')')
1045
_pos
++;
1051
_pos
= _pattern.IndexOf('\n', _pos);
1054
_pos
= _pattern.Length;
1059
_pos
= _pattern.IndexOf(')', _pos);
1062
_pos
= _pattern.Length;
1066
_pos
++;
1089
_pos
++;
1094
_pos
++;
1099
_pos
++;
1104
_pos
++;
1109
_pos
++;
1114
_pos
++;
1119
_pos
++;
1125
_pos
++;
1166
_pos
++;
1167
ch = _pattern[
_pos
++];
1189
_pos
++;
1199
if (_pos < _pattern.Length && _pattern[
_pos
++] == close)
1224
_pos
++;
1265
if (_pos < _pattern.Length && _pattern[
_pos
++] == close)
1276
_pos
= backpos;
1302
_pos
++;
1318
_pos
++;
1335
_pos
++;
1342
_pos
= lastEndPos;
1351
if (!angled || _pos < _pattern.Length && _pattern[
_pos
++] == '}')
1363
if (_pos < _pattern.Length && _pattern[
_pos
++] == '}')
1378
_pos
++;
1404
_pos
++;
1411
_pos
= backpos;
1422
if (!RegexCharClass.IsBoundaryWordChar(_pattern[
_pos
++]))
1424
--
_pos
;
1441
_pos
++;
1464
_pos
++;
1486
char ch = _pattern[
_pos
++];
1513
char ch = _pattern[
_pos
++];
1533
for (bool off = false; _pos < _pattern.Length;
_pos
++)
1576
char ch = _pattern[
_pos
++];
1580
--
_pos
;
1625
char ch = _pattern[
_pos
++];
1634
ch = _pattern[
_pos
++];
1637
--
_pos
;
1644
if (_pos == _pattern.Length || _pattern[
_pos
++] != '}')
1677
char ch = _pattern[
_pos
++];
1690
--
_pos
;
1710
--
_pos
;
1719
_pos
++;
1725
_pos
++;
1753
_pos
++;
153 references to _pos
System.Text.RegularExpressions (153)
System\Text\RegularExpressions\RegexParser.cs (153)
241
i = parser.
_pos
;
279
while (
_pos
< _pattern.Length)
286
int startpos =
_pos
;
292
while (
_pos
< _pattern.Length && (!IsSpecialOrSpace(ch = _pattern[
_pos
]) || (ch == '{' && !IsTrueQuantifier())))
297
while (
_pos
< _pattern.Length && (!IsSpecial(ch = _pattern[
_pos
]) || (ch == '{' && !IsTrueQuantifier())))
301
int endpos =
_pos
;
305
if (
_pos
== _pattern.Length)
309
else if (IsSpecial(ch = _pattern[
_pos
]))
385
if (
_pos
== _pattern.Length)
427
if (
_pos
== _pattern.Length || !(isQuantifier = IsTrueQuantifier()))
457
startpos =
_pos
;
459
if (startpos <
_pos
)
461
if (
_pos
< _pattern.Length && _pattern[
_pos
] == ',')
464
max =
_pos
== _pattern.Length || _pattern[
_pos
] == '}' ? int.MaxValue : ScanDecimal();
468
if (startpos ==
_pos
||
_pos
== _pattern.Length || _pattern[_pos++] != '}')
486
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '?')
523
while (
_pos
< _pattern.Length)
525
int startpos =
_pos
;
527
_pos = _pattern.IndexOf('$',
_pos
);
528
if (
_pos
< 0)
533
AddToConcatenate(startpos,
_pos
- startpos, isReplacement: true);
535
if (
_pos
< _pattern.Length)
557
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '^')
564
if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[
_pos
] == ']')
570
for (;
_pos
< _pattern.Length; firstChar = false)
582
else if (ch == '\\' &&
_pos
< _pattern.Length)
594
charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern,
_pos
);
632
charClass!.AddCategoryFromName(ParseProperty(), ch != 'p', caseInsensitive, _pattern,
_pos
);
682
if (
_pos
< _pattern.Length && _pattern[
_pos
] != ']')
698
else if (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
] == '-' && _pattern[
_pos
+ 1] != ']')
705
else if (
_pos
< _pattern.Length && ch == '-' && !translatedChar && _pattern[
_pos
] == '[' && !firstChar)
715
if (
_pos
< _pattern.Length && _pattern[
_pos
] != ']')
754
if (
_pos
== _pattern.Length || _pattern[
_pos
] != '?' || (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
+ 1] == ')'))
771
if (
_pos
== _pattern.Length)
808
if (
_pos
== _pattern.Length)
855
if (
_pos
< _pattern.Length && !(_pattern[
_pos
] == close || _pattern[
_pos
] == '-'))
875
if (
_pos
< _pattern.Length && !(_pattern[
_pos
] == close || _pattern[
_pos
] == '-'))
892
if ((capnum != -1 || proceed) &&
_pos
+ 1 < _pattern.Length && _pattern[
_pos
] == '-')
895
ch = _pattern[
_pos
];
907
if (
_pos
< _pattern.Length && _pattern[
_pos
] != close)
921
if (
_pos
< _pattern.Length && _pattern[
_pos
] != close)
935
if ((capnum != -1 || uncapnum != -1) &&
_pos
< _pattern.Length && _pattern[_pos++] == close)
946
int parenPos =
_pos
;
947
if (
_pos
< _pattern.Length)
949
ch = _pattern[
_pos
];
955
if (
_pos
< _pattern.Length && _pattern[_pos++] == ')')
971
if (_capnames?[capname] is int tmpCapnum &&
_pos
< _pattern.Length && _pattern[_pos++] == ')')
982
if (
_pos
+ 2 < _pattern.Length && _pattern[
_pos
+ 1] == '?')
985
if (_pattern[
_pos
+ 2] == '#')
991
if (_pattern[
_pos
+ 2] == '\'' || (
_pos
+ 3 < _pattern.Length && _pattern[
_pos
+ 2] == '<' && _pattern[
_pos
+ 3] != '!' && _pattern[
_pos
+ 3] != '='))
1009
if (
_pos
== _pattern.Length)
1043
while (
_pos
< _pattern.Length && IsSpace(_pattern[
_pos
]))
1049
if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 &&
_pos
< _pattern.Length && _pattern[
_pos
] == '#')
1051
_pos = _pattern.IndexOf('\n',
_pos
);
1052
if (
_pos
< 0)
1057
else if (
_pos
+ 2 < _pattern.Length && _pattern[
_pos
+ 2] == '#' && _pattern[
_pos
+ 1] == '?' && _pattern[
_pos
] == '(')
1059
_pos = _pattern.IndexOf(')',
_pos
);
1060
if (
_pos
< 0)
1078
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
1081
switch (ch = _pattern[
_pos
])
1132
cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern,
_pos
);
1153
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
1155
int backpos =
_pos
;
1158
char ch = _pattern[
_pos
];
1164
if (
_pos
+ 1 < _pattern.Length)
1175
if (!angled ||
_pos
== _pattern.Length)
1180
ch = _pattern[
_pos
];
1185
else if ((ch == '<' || ch == '\'') &&
_pos
+ 1 < _pattern.Length)
1190
ch = _pattern[
_pos
];
1199
if (
_pos
< _pattern.Length && _pattern[_pos++] == close)
1216
int pos =
_pos
- 1;
1225
if (
_pos
== _pattern.Length || (ch = _pattern[
_pos
]) < '0' || ch > '9')
1265
if (
_pos
< _pattern.Length && _pattern[_pos++] == close)
1287
if (
_pos
== _pattern.Length)
1292
char ch = _pattern[
_pos
];
1294
int backpos =
_pos
;
1299
if (ch == '{' &&
_pos
+ 1 < _pattern.Length)
1303
ch = _pattern[
_pos
];
1322
lastEndPos =
_pos
;
1325
while (
_pos
< _pattern.Length && (ch = _pattern[
_pos
]) >= '0' && ch <= '9')
1339
lastEndPos =
_pos
;
1351
if (!angled ||
_pos
< _pattern.Length && _pattern[_pos++] == '}')
1363
if (
_pos
< _pattern.Length && _pattern[_pos++] == '}')
1418
int startpos =
_pos
;
1420
while (
_pos
< _pattern.Length)
1429
return _pattern.Substring(startpos,
_pos
- startpos);
1436
int c = Math.Min(3, _pattern.Length -
_pos
);
1439
for (i = 0; c > 0 && (uint)(d = _pattern[
_pos
] - '0') <= 7; c -= 1)
1462
while (
_pos
< _pattern.Length && (uint)(d = (char)(_pattern[
_pos
] - '0')) <= 9)
1482
if (
_pos
+ c <= _pattern.Length)
1508
if (
_pos
== _pattern.Length)
1533
for (bool off = false;
_pos
< _pattern.Length; _pos++)
1535
char ch = _pattern[
_pos
];
1620
if (
_pos
+ 2 >= _pattern.Length)
1631
int startpos =
_pos
;
1632
while (
_pos
< _pattern.Length)
1642
string capname = _pattern.Substring(startpos,
_pos
- startpos);
1644
if (
_pos
== _pattern.Length || _pattern[_pos++] != '}')
1674
while (
_pos
< _pattern.Length)
1676
int pos =
_pos
;
1681
if (
_pos
< _pattern.Length)
1707
if (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
+ 1] == '#' && _pattern[
_pos
] == '?')
1716
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '?')
1721
if (
_pos
+ 1 < _pattern.Length && (_pattern[
_pos
] == '<' || _pattern[
_pos
] == '\''))
1726
ch = _pattern[
_pos
];
1748
if (
_pos
< _pattern.Length)
1750
if (_pattern[
_pos
] == ')')
1756
else if (_pattern[
_pos
] == '(')
1976
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
1978
int startpos =
_pos
;
1986
int nChars = _pattern.Length -
_pos
;
2112
new RegexParseException(error,
_pos
, SR.Format(SR.MakeException, _pattern,
_pos
, message));