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)
450
if (_pos ==
_pattern
.Length || !(isQuantifier = IsTrueQuantifier()))
457
ch =
_pattern
[_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)
550
_pos =
_pattern
.IndexOf('$', _pos);
553
_pos =
_pattern
.Length;
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)
626
ch =
_pattern
[_pos++];
647
if (_pos <
_pattern
.Length &&
_pattern
[_pos] != ']')
660
else if (ch == '\\' && _pos <
_pattern
.Length)
662
switch (ch =
_pattern
[_pos++])
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)
848
char ch =
_pattern
[_pos++];
878
if (_pos ==
_pattern
.Length)
883
switch (ch =
_pattern
[_pos++])
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)
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)
1085
if ((ch =
_pattern
[_pos++]) == ')')
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);
1125
_pos =
_pattern
.Length;
1128
else if (_pos + 2 <
_pattern
.Length &&
_pattern
[_pos + 2] == '#' &&
_pattern
[_pos + 1] == '?' &&
_pattern
[_pos] == '(')
1130
_pos =
_pattern
.IndexOf(')', _pos);
1133
_pos =
_pattern
.Length;
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");
1233
char ch =
_pattern
[_pos];
1239
if (_pos + 1 <
_pattern
.Length)
1242
ch =
_pattern
[_pos++];
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)
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];
1374
if (ch == '{' && _pos + 1 <
_pattern
.Length)
1378
ch =
_pattern
[_pos];
1400
while (_pos <
_pattern
.Length && (ch =
_pattern
[_pos]) >= '0' && ch <= '9')
1426
if (!angled || _pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1438
if (_pos <
_pattern
.Length &&
_pattern
[_pos++] == '}')
1495
while (_pos <
_pattern
.Length)
1497
if (!RegexCharClass.IsBoundaryWordChar(
_pattern
[_pos++]))
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)
1561
char ch =
_pattern
[_pos++];
1583
if (_pos ==
_pattern
.Length)
1588
char ch =
_pattern
[_pos++];
1608
for (bool off = false; _pos <
_pattern
.Length; _pos++)
1610
char ch =
_pattern
[_pos];
1651
char ch =
_pattern
[_pos++];
1695
if (_pos + 2 >=
_pattern
.Length)
1700
char ch =
_pattern
[_pos++];
1707
while (_pos <
_pattern
.Length)
1709
ch =
_pattern
[_pos++];
1717
string capname =
_pattern
.Substring(startpos, _pos - startpos);
1719
if (_pos ==
_pattern
.Length ||
_pattern
[_pos++] != '}')
1868
while (_pos <
_pattern
.Length)
1871
char ch =
_pattern
[_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");
2155
char ch =
_pattern
[startpos];
2162
int nChars =
_pattern
.Length - _pos;
2163
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2180
while (--nChars > 0 && (uint)((ch =
_pattern
[++pos]) - '0') <= 9) ;
2194
_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(
_pattern
[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior));
2197
case > 1 when (_options & RegexOptions.IgnoreCase) == 0 || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(
_pattern
.AsSpan(pos, cch)):
2198
_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase,
_pattern
.Substring(pos, cch)));
2202
foreach (char c in
_pattern
.AsSpan(pos, cch))
2288
new RegexParseException(error, _pos, SR.Format(SR.MakeException,
_pattern
, _pos, message));