83 writes to _pos
System.Text.RegularExpressions (83)
System\Text\RegularExpressions\RegexParser.cs (83)
75
_pos
= 0;
235
parser.
_pos
= i;
259
_pos
= 0;
293
_pos
++;
298
_pos
++;
312
_pos
++;
440
--
_pos
;
457
ch = _pattern[
_pos
++];
486
_pos
++;
491
if (startpos == _pos || _pos == _pattern.Length || _pattern[
_pos
++] != '}')
495
_pos
= startpos - 1;
511
_pos
++;
550
_pos
= _pattern.IndexOf('$', _pos);
553
_pos
= _pattern.Length;
560
_pos
++;
589
_pos
++;
609
_pos
++;
626
ch = _pattern[
_pos
++];
662
switch (ch = _pattern[
_pos
++])
740
--
_pos
;
780
_pos
++;
786
_pos
++;
837
_pos
++;
848
char ch = _pattern[
_pos
++];
883
switch (ch = _pattern[
_pos
++])
908
--
_pos
;
964
_pos
++;
1005
if ((capnum != -1 || uncapnum != -1) && _pos < _pattern.Length && _pattern[
_pos
++] == close)
1025
if (_pos < _pattern.Length && _pattern[
_pos
++] == ')')
1041
if (_capnames?[capname] is int tmpCapnum && _pos < _pattern.Length && _pattern[
_pos
++] == ')')
1049
_pos
= parenPos - 1; // jump to the start of the parentheses
1070
--
_pos
;
1085
if ((ch = _pattern[
_pos
++]) == ')')
1116
_pos
++;
1122
_pos
= _pattern.IndexOf('\n', _pos);
1125
_pos
= _pattern.Length;
1130
_pos
= _pattern.IndexOf(')', _pos);
1133
_pos
= _pattern.Length;
1137
_pos
++;
1159
_pos
++;
1164
_pos
++;
1169
_pos
++;
1174
_pos
++;
1179
_pos
++;
1184
_pos
++;
1189
_pos
++;
1194
_pos
++;
1200
_pos
++;
1241
_pos
++;
1242
ch = _pattern[
_pos
++];
1264
_pos
++;
1274
if (_pos < _pattern.Length && _pattern[
_pos
++] == close)
1299
_pos
++;
1340
if (_pos < _pattern.Length && _pattern[
_pos
++] == close)
1351
_pos
= backpos;
1377
_pos
++;
1393
_pos
++;
1410
_pos
++;
1417
_pos
= lastEndPos;
1426
if (!angled || _pos < _pattern.Length && _pattern[
_pos
++] == '}')
1438
if (_pos < _pattern.Length && _pattern[
_pos
++] == '}')
1453
_pos
++;
1479
_pos
++;
1486
_pos
= backpos;
1497
if (!RegexCharClass.IsBoundaryWordChar(_pattern[
_pos
++]))
1499
--
_pos
;
1516
_pos
++;
1539
_pos
++;
1561
char ch = _pattern[
_pos
++];
1588
char ch = _pattern[
_pos
++];
1608
for (bool off = false; _pos < _pattern.Length;
_pos
++)
1651
char ch = _pattern[
_pos
++];
1655
--
_pos
;
1700
char ch = _pattern[
_pos
++];
1709
ch = _pattern[
_pos
++];
1712
--
_pos
;
1719
if (_pos == _pattern.Length || _pattern[
_pos
++] != '}')
1871
char ch = _pattern[
_pos
++];
1884
--
_pos
;
1904
--
_pos
;
1913
_pos
++;
1919
_pos
++;
1947
_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)
450
if (
_pos
== _pattern.Length || !(isQuantifier = IsTrueQuantifier()))
480
startpos =
_pos
;
482
if (startpos <
_pos
)
484
if (
_pos
< _pattern.Length && _pattern[
_pos
] == ',')
487
max =
_pos
== _pattern.Length || _pattern[
_pos
] == '}' ? int.MaxValue : ScanDecimal();
491
if (startpos ==
_pos
||
_pos
== _pattern.Length || _pattern[_pos++] != '}')
509
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '?')
546
while (
_pos
< _pattern.Length)
548
int startpos =
_pos
;
550
_pos = _pattern.IndexOf('$',
_pos
);
551
if (
_pos
< 0)
556
AddToConcatenate(startpos,
_pos
- startpos, isReplacement: true);
558
if (
_pos
< _pattern.Length)
587
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '^')
594
if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[
_pos
] == ']')
600
for (;
_pos
< _pattern.Length; firstChar = false)
607
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '^')
614
if ((_options & RegexOptions.ECMAScript) != 0 &&
_pos
< _pattern.Length && _pattern[
_pos
] == ']')
619
if (
_pos
>= _pattern.Length)
647
if (
_pos
< _pattern.Length && _pattern[
_pos
] != ']')
660
else if (ch == '\\' &&
_pos
< _pattern.Length)
672
charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern,
_pos
);
710
charClass!.AddCategoryFromName(ParseProperty(), ch != 'p', caseInsensitive, _pattern,
_pos
);
775
else if (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
] == '-' && _pattern[
_pos
+ 1] != ']')
782
else if (
_pos
< _pattern.Length && ch == '-' && !translatedChar && _pattern[
_pos
] == '[' && !firstChar)
824
if (
_pos
== _pattern.Length || _pattern[
_pos
] != '?' || (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
+ 1] == ')'))
841
if (
_pos
== _pattern.Length)
878
if (
_pos
== _pattern.Length)
925
if (
_pos
< _pattern.Length && !(_pattern[
_pos
] == close || _pattern[
_pos
] == '-'))
945
if (
_pos
< _pattern.Length && !(_pattern[
_pos
] == close || _pattern[
_pos
] == '-'))
962
if ((capnum != -1 || proceed) &&
_pos
+ 1 < _pattern.Length && _pattern[
_pos
] == '-')
965
ch = _pattern[
_pos
];
977
if (
_pos
< _pattern.Length && _pattern[
_pos
] != close)
991
if (
_pos
< _pattern.Length && _pattern[
_pos
] != close)
1005
if ((capnum != -1 || uncapnum != -1) &&
_pos
< _pattern.Length && _pattern[_pos++] == close)
1016
int parenPos =
_pos
;
1017
if (
_pos
< _pattern.Length)
1019
ch = _pattern[
_pos
];
1025
if (
_pos
< _pattern.Length && _pattern[_pos++] == ')')
1041
if (_capnames?[capname] is int tmpCapnum &&
_pos
< _pattern.Length && _pattern[_pos++] == ')')
1052
if (
_pos
+ 2 < _pattern.Length && _pattern[
_pos
+ 1] == '?')
1055
if (_pattern[
_pos
+ 2] == '#')
1061
if (_pattern[
_pos
+ 2] == '\'' || (
_pos
+ 3 < _pattern.Length && _pattern[
_pos
+ 2] == '<' && _pattern[
_pos
+ 3] != '!' && _pattern[
_pos
+ 3] != '='))
1080
if (
_pos
== _pattern.Length)
1114
while (
_pos
< _pattern.Length && IsSpace(_pattern[
_pos
]))
1120
if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 &&
_pos
< _pattern.Length && _pattern[
_pos
] == '#')
1122
_pos = _pattern.IndexOf('\n',
_pos
);
1123
if (
_pos
< 0)
1128
else if (
_pos
+ 2 < _pattern.Length && _pattern[
_pos
+ 2] == '#' && _pattern[
_pos
+ 1] == '?' && _pattern[
_pos
] == '(')
1130
_pos = _pattern.IndexOf(')',
_pos
);
1131
if (
_pos
< 0)
1149
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
1152
switch (ch = _pattern[
_pos
])
1207
cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern,
_pos
);
1228
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
1230
int backpos =
_pos
;
1233
char ch = _pattern[
_pos
];
1239
if (
_pos
+ 1 < _pattern.Length)
1250
if (!angled ||
_pos
== _pattern.Length)
1255
ch = _pattern[
_pos
];
1260
else if ((ch == '<' || ch == '\'') &&
_pos
+ 1 < _pattern.Length)
1265
ch = _pattern[
_pos
];
1274
if (
_pos
< _pattern.Length && _pattern[_pos++] == close)
1291
int pos =
_pos
- 1;
1300
if (
_pos
== _pattern.Length || (ch = _pattern[
_pos
]) < '0' || ch > '9')
1340
if (
_pos
< _pattern.Length && _pattern[_pos++] == close)
1362
if (
_pos
== _pattern.Length)
1367
char ch = _pattern[
_pos
];
1369
int backpos =
_pos
;
1374
if (ch == '{' &&
_pos
+ 1 < _pattern.Length)
1378
ch = _pattern[
_pos
];
1397
lastEndPos =
_pos
;
1400
while (
_pos
< _pattern.Length && (ch = _pattern[
_pos
]) >= '0' && ch <= '9')
1414
lastEndPos =
_pos
;
1426
if (!angled ||
_pos
< _pattern.Length && _pattern[_pos++] == '}')
1438
if (
_pos
< _pattern.Length && _pattern[_pos++] == '}')
1493
int startpos =
_pos
;
1495
while (
_pos
< _pattern.Length)
1504
return _pattern.Substring(startpos,
_pos
- startpos);
1511
int c = Math.Min(3, _pattern.Length -
_pos
);
1514
for (i = 0; c > 0 && (uint)(d = _pattern[
_pos
] - '0') <= 7; c -= 1)
1537
while (
_pos
< _pattern.Length && (uint)(d = (char)(_pattern[
_pos
] - '0')) <= 9)
1557
if (
_pos
+ c <= _pattern.Length)
1583
if (
_pos
== _pattern.Length)
1608
for (bool off = false;
_pos
< _pattern.Length; _pos++)
1610
char ch = _pattern[
_pos
];
1695
if (
_pos
+ 2 >= _pattern.Length)
1706
int startpos =
_pos
;
1707
while (
_pos
< _pattern.Length)
1717
string capname = _pattern.Substring(startpos,
_pos
- startpos);
1719
if (
_pos
== _pattern.Length || _pattern[_pos++] != '}')
1868
while (
_pos
< _pattern.Length)
1870
int pos =
_pos
;
1875
if (
_pos
< _pattern.Length)
1901
if (
_pos
+ 1 < _pattern.Length && _pattern[
_pos
+ 1] == '#' && _pattern[
_pos
] == '?')
1910
if (
_pos
< _pattern.Length && _pattern[
_pos
] == '?')
1915
if (
_pos
+ 1 < _pattern.Length && (_pattern[
_pos
] == '<' || _pattern[
_pos
] == '\''))
1920
ch = _pattern[
_pos
];
1942
if (
_pos
< _pattern.Length)
1944
if (_pattern[
_pos
] == ')')
1950
else if (_pattern[
_pos
] == '(')
2152
Debug.Assert(
_pos
< _pattern.Length, "The current reading position must not be at the end of the pattern");
2154
int startpos =
_pos
;
2162
int nChars = _pattern.Length -
_pos
;
2288
new RegexParseException(error,
_pos
, SR.Format(SR.MakeException, _pattern,
_pos
, message));