19 writes to Str
System.Text.RegularExpressions (19)
System\Text\RegularExpressions\RegexNode.cs (19)
68Str = str; 190Str = null; 198Str = new string(Ch, N); 964Str = null; 969Str = null; 979Str = null; 997Str = RegexCharClass.AnyClass; 1002Str = RegexCharClass.NotDigitClass; 1005Str = RegexCharClass.NotSpaceClass; 1008Str = RegexCharClass.NotWordClass; 1165prev.Str = prevCharClass.ToStringClass(); 1457node.Str = null; 1463node.Str = null; 1467node.Str = node.Str.Substring(startingSpan.Length); 1717prev.Str = prev.Ch.ToString(); 1720prev.Str = (optionsAt & RegexOptions.RightToLeft) == 0 ? 1863nextNode.Str = null; 1867nextNode.Str = nextNode.Str.Substring(matchingCharsInMulti); 3006Str = new string(Ch, max);
144 references to Str
System.Text.RegularExpressions (144)
System\Text\RegularExpressions\RegexCompiler.cs (18)
1339EmitMatchCharacterClass(target.LoopNode.Str!); 1448int length = node.Kind == RegexNodeKind.Multi ? node.Str!.Length : 1; 3004EmitMatchCharacterClass(node.Str); 3236EmitMultiCharString(node.Str!, emitLengthCheck, (node.Options & RegexOptions.RightToLeft) != 0); 3746node.Str == RegexCharClass.AnyClass && 4274if (node.IsSetFamily && node.Str == RegexCharClass.AnyClass) 4416EmitMatchCharacterClass(node.Str); 4451else if (node.IsSetFamily && maxIterations == int.MaxValue && node.Str == RegexCharClass.AnyClass) 4531EmitMatchCharacterClass(node.Str); 4653EmitMatchCharacterClass(node.Str); 5135literalLength = node.Str!.Length; 5148if (RegexCharClass.TryGetSingleRange(node.Str, out _, out _) || 5149RegexCharClass.GetSetChars(node.Str, setChars) > 0) 5170Ldstr(node.Str!); 5198bool negated = RegexCharClass.IsNegated(node.Str) ^ negate; 5202if (RegexCharClass.TryGetSingleRange(node.Str, out char lowInclusive, out char highInclusive) && 5219int setCharsCount = RegexCharClass.GetSetChars(node.Str, setChars); 5377Ldc((root.Kind == RegexNodeKind.Multi ? root.Str!.Length : 1) * (!rtl ? 1 : -1));
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
841while ((uint)--prev < (uint)slice.Length && RegexCharClass.CharInClass(slice[prev], loopNode.Str!, ref _asciiLookups![0])) ;
System\Text\RegularExpressions\RegexNode.cs (93)
95new RegexNode(Kind, Options, Str!) : 332Debug.Assert(node.Str is not null, "Expect non-null multi string"); 333Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 959Debug.Assert(!string.IsNullOrEmpty(Str)); 961if (RegexCharClass.IsEmpty(Str)) 966else if (RegexCharClass.IsSingleton(Str)) 968Ch = RegexCharClass.SingletonChar(Str); 976else if (RegexCharClass.IsSingletonInverse(Str)) 978Ch = RegexCharClass.SingletonChar(Str); 988switch (Str) 1113if (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !RegexCharClass.IsMergeable(at.Str!)) 1116lastNodeCannotMerge = !RegexCharClass.IsMergeable(at.Str!); 1147prevCharClass = RegexCharClass.Parse(prev.Str!); 1160RegexCharClass atCharClass = RegexCharClass.Parse(at.Str!); 1248required.Str != other.Str) 1363scoped ReadOnlySpan<char> startingSpan = startingNode.Str.AsSpan(); 1399Debug.Assert(startingNode.Str!.Length > 0); 1401int minLength = Math.Min(startingSpan.Length, startingNode.Str.Length); 1403while (c < minLength && startingSpan[c] == startingNode.Str[c]) c++; 1453Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1454if (node.Str!.Length == startingSpan.Length) 1459else if (node.Str.Length - 1 == startingSpan.Length) 1462node.Ch = node.Str[node.Str.Length - 1]; 1467node.Str = node.Str.Substring(startingSpan.Length); 1509return IsOneFamily ? Ch : Str![0]; 1564if (RegexCharClass.TryGetSingleRange(node.Str!, out char lowInclusive, out char highInclusive) && 1568return new StartingLiteralData(range: (lowInclusive, highInclusive), negated: RegexCharClass.IsNegated(node.Str!)); 1573if ((numChars = RegexCharClass.GetSetChars(node.Str!, setChars)) != 0) 1575return new StartingLiteralData(setChars: setChars.Slice(0, numChars).ToString(), negated: RegexCharClass.IsNegated(node.Str!)); 1580return new StartingLiteralData(@string: node.Str); 1721((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1722((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1786case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when nextNode.Kind == currentNode.Kind && currentNode.Str == nextNode.Str: 1813case RegexNodeKind.Setloop or RegexNodeKind.Setlazy when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1830currentNode.Ch == nextNode.Str![0]: 1835while (matchingCharsInMulti < nextNode.Str.Length && currentNode.Ch == nextNode.Str[matchingCharsInMulti]) 1850if (nextNode.Str.Length == matchingCharsInMulti) 1858Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1859if (nextNode.Str.Length - matchingCharsInMulti == 1) 1862nextNode.Ch = nextNode.Str[nextNode.Str.Length - 1]; 1867nextNode.Str = nextNode.Str.Substring(matchingCharsInMulti); 1881case RegexNodeKind.Set when (nextNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) && currentNode.Str == nextNode.Str: 1895case RegexNodeKind.Set when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 2352case RegexNodeKind.Set when !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2355case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2356case RegexNodeKind.Multi when node.Ch != subsequent.Str![0]: 2367case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2382case RegexNodeKind.Multi when node.Ch == subsequent.Str![0]: 2399case RegexNodeKind.One when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2400case RegexNodeKind.Set when !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2401case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2402case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2403case RegexNodeKind.Multi when !RegexCharClass.CharInClass(subsequent.Str![0], node.Str!): 2405case RegexNodeKind.EndZ or RegexNodeKind.Eol when !RegexCharClass.CharInClass('\n', node.Str!): 2406case RegexNodeKind.Boundary when node.M > 0 && RegexCharClass.IsKnownWordClassSubset(node.Str!): 2407case RegexNodeKind.NonBoundary when node.M > 0 && node.Str is RegexCharClass.NotWordClass or RegexCharClass.NotDigitClass: 2408case RegexNodeKind.ECMABoundary when node.M > 0 && node.Str is RegexCharClass.ECMAWordClass or RegexCharClass.ECMADigitClass: 2409case RegexNodeKind.NonECMABoundary when node.M > 0 && node.Str is RegexCharClass.NotECMAWordClass or RegexCharClass.NotDigitClass: 2412case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2413case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2447case RegexNodeKind.Set when !MayOverlapStartingOrEndingSet(subsequent.Str!): 2449case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !MayOverlapStartingOrEndingSet(subsequent.Str!): 2450case RegexNodeKind.Multi when !CharInStartingOrEndingSet(subsequent.Str![0]): 2460case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !MayOverlapStartingOrEndingSet(subsequent.Str!): 2596return Str!.Length; 2709return Str!.Length; 2872if (!RegexCharClass.IsAscii(child.Str.AsSpan()) || 2873RegexCharClass.ParticipatesInCaseConversion(child.Str.AsSpan())) 2878vsb.Append(child.Str); 2885if (!RegexCharClass.SetContainsAsciiOrdinalIgnoreCaseCharacter(child.Str!, twoChars)) 3143[MemberNotNullWhen(true, nameof(Str))] 3224foreach (char c in Str!) 3234sb.Append(' ').Append(RegexCharClass.DescribeSet(Str!));
System\Text\RegularExpressions\RegexNodeKind.cs (5)
22/// <remarks>The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>.</remarks> 26/// <remarks>The characters are specified in <see cref="RegexNode.Str"/>. This is purely a representational optimization, equivalent to multiple <see cref="One"/> nodes concatenated together.</remarks> 40/// <remarks>The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 53/// <remarks>The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.</remarks> 71/// The <see cref="RegexCharClass"/> set string is specified in <see cref="RegexNode.Str"/>, the minimum number of iterations in <see cref="RegexNode.M"/>, and the maximum number of iterations in <see cref="RegexNode.N"/>.
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (20)
129sb.Append(node.Str); 136foreach (char c in node.Str!) 156case RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic when !RegexCharClass.IsNegated(node.Str!): // negated sets are too complex to analyze 158int charCount = RegexCharClass.GetSetChars(node.Str!, setChars); 197if (!RegexCharClass.SetContainsAsciiOrdinalIgnoreCaseCharacter(node.Str!, setChars)) 428vsb.Append(node.Str); 623string s = node.Str!; 636results.Add(new RegexFindOptimizations.FixedDistanceSet(null, node.Str!, distance++)); 647results.Add(new RegexFindOptimizations.FixedDistanceSet(null, node.Str!, distance++)); 986cc = RegexCharClass.Parse(node.Str!); 989else if (cc.CanMerge && RegexCharClass.Parse(node.Str!) is { CanMerge: true } setCc) 1005cc.AddChar(node.Str![firstChar ? 0 : node.Str.Length - 1]); 1184RegexCharClass.CharInClass(prefix[0], firstChild.Str!) ? null : 1205if (RegexCharClass.CharInClass((char)(ordinalCaseInsensitivePrefix[0] | 0x20), firstChild.Str!) || 1206RegexCharClass.CharInClass((char)(ordinalCaseInsensitivePrefix[0] & ~0x20), firstChild.Str!)) 1211else if (RegexCharClass.CharInClass(ordinalCaseInsensitivePrefix[0], firstChild.Str!)) 1232!RegexCharClass.IsNegated(nextChild.Str!) && 1236chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars)); 1241if (RegexCharClass.CharInClass(c, firstChild.Str!))
System\Text\RegularExpressions\RegexReplacement.cs (1)
51vsb.Append(child.Str!);
System\Text\RegularExpressions\RegexWriter.cs (3)
407int stringCode = StringCode(node.Str!); 420Emit((RegexOpcode)node.Kind | bits, StringCode(node.Str!)); 424Emit((RegexOpcode)node.Kind | bits, StringCode(node.Str!));
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (3)
72string? str = node.Str; 125string? set = node.Str; 314string? set = node.Str;