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