1 write to _pattern
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\RegexParser.cs (1)
60
_pattern
= pattern;
168 references to _pattern
System.Text.RegularExpressions (168)
System\Text\RegularExpressions\RegexParser.cs (168)
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)
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)
603
ch =
_pattern
[_pos++];
624
if (_pos <
_pattern
.Length &&
_pattern
[_pos] != ']')
637
else if (ch == '\\' && _pos <
_pattern
.Length)
639
switch (ch =
_pattern
[_pos++])
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)
825
char ch =
_pattern
[_pos++];
855
if (_pos ==
_pattern
.Length)
860
switch (ch =
_pattern
[_pos++])
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)
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)
1061
if ((ch =
_pattern
[_pos++]) == ')')
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);
1101
_pos =
_pattern
.Length;
1104
else if (_pos + 2 <
_pattern
.Length &&
_pattern
[_pos + 2] == '#' &&
_pattern
[_pos + 1] == '?' &&
_pattern
[_pos] == '(')
1106
_pos =
_pattern
.IndexOf(')', _pos);
1109
_pos =
_pattern
.Length;
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");
1205
char ch =
_pattern
[_pos];
1211
if (_pos + 1 <
_pattern
.Length)
1214
ch =
_pattern
[_pos++];
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)
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];
1346
if (ch == '{' && _pos + 1 <
_pattern
.Length)
1350
ch =
_pattern
[_pos];
1372
while (_pos <
_pattern
.Length && (ch =
_pattern
[_pos]) >= '0' && ch <= '9')
1398
if (!angled || _pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1410
if (_pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1467
while (_pos <
_pattern
.Length)
1469
if (!RegexCharClass.IsBoundaryWordChar(
_pattern
[_pos++]))
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)
1533
char ch =
_pattern
[_pos++];
1555
if (_pos ==
_pattern
.Length)
1560
char ch =
_pattern
[_pos++];
1580
for (bool off = false; _pos <
_pattern
.Length; _pos++)
1582
char ch =
_pattern
[_pos];
1623
char ch =
_pattern
[_pos++];
1667
if (_pos + 2 >=
_pattern
.Length)
1672
char ch =
_pattern
[_pos++];
1679
while (_pos <
_pattern
.Length)
1681
ch =
_pattern
[_pos++];
1689
string capname =
_pattern
.Substring(startpos, _pos - startpos);
1691
if (_pos ==
_pattern
.Length ||
_pattern
[_pos++] != '}')
1721
while (_pos <
_pattern
.Length)
1724
char ch =
_pattern
[_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");
2008
char ch =
_pattern
[startpos];
2015
int nChars =
_pattern
.Length - _pos;
2016
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2033
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2047
_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(
_pattern
[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior));
2050
case > 1 when (_options & RegexOptions.IgnoreCase) == 0 || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(
_pattern
.AsSpan(pos, cch)):
2051
_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase,
_pattern
.Substring(pos, cch)));
2055
foreach (char c in
_pattern
.AsSpan(pos, cch))
2141
new RegexParseException(error, _pos, SR.Format(SR.MakeException,
_pattern
, _pos, message));