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)
279
while (_pos <
_pattern
.Length)
292
while (_pos <
_pattern
.Length && (!IsSpecialOrSpace(ch =
_pattern
[_pos]) || (ch == '{' && !IsTrueQuantifier())))
297
while (_pos <
_pattern
.Length && (!IsSpecial(ch =
_pattern
[_pos]) || (ch == '{' && !IsTrueQuantifier())))
305
if (_pos ==
_pattern
.Length)
309
else if (IsSpecial(ch =
_pattern
[_pos]))
332
_unit = RegexNode.CreateOneWithCaseConversion(
_pattern
[endpos - 1], _options, _culture, ref _caseBehavior);
385
if (_pos ==
_pattern
.Length)
427
if (_pos ==
_pattern
.Length || !(isQuantifier = IsTrueQuantifier()))
434
ch =
_pattern
[_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)
527
_pos =
_pattern
.IndexOf('$', _pos);
530
_pos =
_pattern
.Length;
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)
573
ch =
_pattern
[_pos++];
582
else if (ch == '\\' && _pos <
_pattern
.Length)
584
switch (ch =
_pattern
[_pos++])
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)
778
char ch =
_pattern
[_pos++];
808
if (_pos ==
_pattern
.Length)
813
switch (ch =
_pattern
[_pos++])
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)
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)
1014
if ((ch =
_pattern
[_pos++]) == ')')
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);
1054
_pos =
_pattern
.Length;
1057
else if (_pos + 2 <
_pattern
.Length &&
_pattern
[_pos + 2] == '#' &&
_pattern
[_pos + 1] == '?' &&
_pattern
[_pos] == '(')
1059
_pos =
_pattern
.IndexOf(')', _pos);
1062
_pos =
_pattern
.Length;
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");
1158
char ch =
_pattern
[_pos];
1164
if (_pos + 1 <
_pattern
.Length)
1167
ch =
_pattern
[_pos++];
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)
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];
1299
if (ch == '{' && _pos + 1 <
_pattern
.Length)
1303
ch =
_pattern
[_pos];
1325
while (_pos <
_pattern
.Length && (ch =
_pattern
[_pos]) >= '0' && ch <= '9')
1351
if (!angled || _pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1363
if (_pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1420
while (_pos <
_pattern
.Length)
1422
if (!RegexCharClass.IsBoundaryWordChar(
_pattern
[_pos++]))
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)
1486
char ch =
_pattern
[_pos++];
1508
if (_pos ==
_pattern
.Length)
1513
char ch =
_pattern
[_pos++];
1533
for (bool off = false; _pos <
_pattern
.Length; _pos++)
1535
char ch =
_pattern
[_pos];
1576
char ch =
_pattern
[_pos++];
1620
if (_pos + 2 >=
_pattern
.Length)
1625
char ch =
_pattern
[_pos++];
1632
while (_pos <
_pattern
.Length)
1634
ch =
_pattern
[_pos++];
1642
string capname =
_pattern
.Substring(startpos, _pos - startpos);
1644
if (_pos ==
_pattern
.Length ||
_pattern
[_pos++] != '}')
1674
while (_pos <
_pattern
.Length)
1677
char ch =
_pattern
[_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");
1979
char ch =
_pattern
[startpos];
1986
int nChars =
_pattern
.Length - _pos;
1987
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2004
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2018
_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(
_pattern
[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior));
2021
case > 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)));
2026
foreach (char c in
_pattern
.AsSpan(pos, cch))
2112
new RegexParseException(error, _pos, SR.Format(SR.MakeException,
_pattern
, _pos, message));