16 writes to Str
System.Text.RegularExpressions (16)
System\Text\RegularExpressions\RegexNode.cs (16)
68Str = str; 178Str = null; 186Str = new string(Ch, N); 882Str = null; 887Str = null; 897Str = null; 915Str = RegexCharClass.AnyClass; 1047prev.Str = prevCharClass.ToStringClass(); 1335node.Str = null; 1341node.Str = null; 1345node.Str = node.Str.Substring(startingSpan.Length); 1595prev.Str = prev.Ch.ToString(); 1598prev.Str = (optionsAt & RegexOptions.RightToLeft) == 0 ? 1738nextNode.Str = null; 1742nextNode.Str = nextNode.Str.Substring(matchingCharsInMulti); 2692Str = new string(Ch, max);
123 references to Str
System.Text.RegularExpressions (123)
System\Text\RegularExpressions\RegexCompiler.cs (1)
1336EmitMatchCharacterClass(target.LoopNode.Str!);
System\Text\RegularExpressions\RegexFindOptimizations.cs (1)
782while ((uint)--prev < (uint)slice.Length && RegexCharClass.CharInClass(slice[prev], loopNode.Str!, ref _asciiLookups![0])) ;
System\Text\RegularExpressions\RegexNode.cs (89)
95new RegexNode(Kind, Options, Str!) : 292Debug.Assert(node.Str is not null, "Expect non-null multi string"); 293Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 300Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 304Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 879if (RegexCharClass.IsEmpty(Str)) 884else if (RegexCharClass.IsSingleton(Str)) 886Ch = RegexCharClass.SingletonChar(Str); 894else if (RegexCharClass.IsSingletonInverse(Str)) 896Ch = RegexCharClass.SingletonChar(Str); 906switch (Str) 1004if (!wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !RegexCharClass.IsMergeable(at.Str!)) 1007lastNodeCannotMerge = !RegexCharClass.IsMergeable(at.Str!); 1033prevCharClass = RegexCharClass.Parse(prev.Str!); 1042RegexCharClass atCharClass = RegexCharClass.Parse(at.Str!); 1126required.Str != other.Str) 1241scoped ReadOnlySpan<char> startingSpan = startingNode.Str.AsSpan(); 1277Debug.Assert(startingNode.Str!.Length > 0); 1279int minLength = Math.Min(startingSpan.Length, startingNode.Str.Length); 1281while (c < minLength && startingSpan[c] == startingNode.Str[c]) c++; 1331Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1332if (node.Str!.Length == startingSpan.Length) 1337else if (node.Str.Length - 1 == startingSpan.Length) 1340node.Ch = node.Str[node.Str.Length - 1]; 1345node.Str = node.Str.Substring(startingSpan.Length); 1387return IsOneFamily ? Ch : Str![0]; 1442if (RegexCharClass.TryGetSingleRange(node.Str!, out char lowInclusive, out char highInclusive) && 1446return new StartingLiteralData(range: (lowInclusive, highInclusive), negated: RegexCharClass.IsNegated(node.Str!)); 1451if ((numChars = RegexCharClass.GetSetChars(node.Str!, setChars)) != 0) 1453return new StartingLiteralData(setChars: setChars.Slice(0, numChars).ToString(), negated: RegexCharClass.IsNegated(node.Str!)); 1458return new StartingLiteralData(@string: node.Str); 1599((at.Kind == RegexNodeKind.One) ? $"{prev.Str}{at.Ch}" : prev.Str + at.Str) : 1600((at.Kind == RegexNodeKind.One) ? $"{at.Ch}{prev.Str}" : at.Str + prev.Str); 1664case RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy when nextNode.Kind == currentNode.Kind && currentNode.Str == nextNode.Str: 1691case RegexNodeKind.Setloop or RegexNodeKind.Setlazy when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 1705case RegexNodeKind.Oneloop or RegexNodeKind.Onelazy when nextNode.Kind == RegexNodeKind.Multi && currentNode.Ch == nextNode.Str![0]: 1710while (matchingCharsInMulti < nextNode.Str.Length && currentNode.Ch == nextNode.Str[matchingCharsInMulti]) 1725if (nextNode.Str.Length == matchingCharsInMulti) 1733Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1734if (nextNode.Str.Length - matchingCharsInMulti == 1) 1737nextNode.Ch = nextNode.Str[nextNode.Str.Length - 1]; 1742nextNode.Str = nextNode.Str.Substring(matchingCharsInMulti); 1756case RegexNodeKind.Set when (nextNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy) && currentNode.Str == nextNode.Str: 1770case RegexNodeKind.Set when nextNode.Kind == RegexNodeKind.Set && currentNode.Str == nextNode.Str: 2119case RegexNodeKind.Set when !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2122case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2123case RegexNodeKind.Multi when node.Ch != subsequent.Str![0]: 2130case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(node.Ch, subsequent.Str!): 2149case RegexNodeKind.Multi when node.Ch == subsequent.Str![0]: 2166case RegexNodeKind.One when !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2167case RegexNodeKind.Set when !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2168case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M > 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2169case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M > 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2170case RegexNodeKind.Multi when !RegexCharClass.CharInClass(subsequent.Str![0], node.Str!): 2172case RegexNodeKind.EndZ or RegexNodeKind.Eol when !RegexCharClass.CharInClass('\n', node.Str!): 2175case RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic when subsequent.M == 0 && !RegexCharClass.CharInClass(subsequent.Ch, node.Str!): 2176case RegexNodeKind.Setlazy or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic when subsequent.M == 0 && !RegexCharClass.MayOverlap(node.Str!, subsequent.Str!): 2177case RegexNodeKind.Boundary when node.M > 0 && node.Str is RegexCharClass.WordClass or RegexCharClass.DigitClass: 2178case RegexNodeKind.NonBoundary when node.M > 0 && node.Str is RegexCharClass.NotWordClass or RegexCharClass.NotDigitClass: 2179case RegexNodeKind.ECMABoundary when node.M > 0 && node.Str is RegexCharClass.ECMAWordClass or RegexCharClass.ECMADigitClass: 2180case RegexNodeKind.NonECMABoundary when node.M > 0 && node.Str is RegexCharClass.NotECMAWordClass or RegexCharClass.NotDigitClass: 2267return Str!.Length; 2380return Str!.Length; 2543if (!RegexCharClass.IsAscii(child.Str.AsSpan()) || 2544RegexCharClass.ParticipatesInCaseConversion(child.Str.AsSpan())) 2549vsb.Append(child.Str); 2556if (!RegexCharClass.SetContainsAsciiOrdinalIgnoreCaseCharacter(child.Str!, twoChars)) 2829[MemberNotNullWhen(true, nameof(Str))] 2910foreach (char c in Str!) 2920sb.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++)); 977cc = RegexCharClass.Parse(node.Str!); 980else if (cc.CanMerge && RegexCharClass.Parse(node.Str!) is { CanMerge: true } setCc) 995cc.AddChar(node.Str![(node.Options & RegexOptions.RightToLeft) != 0 ? node.Str.Length - 1 : 0]); 1160RegexCharClass.CharInClass(prefix[0], firstChild.Str!) ? null : 1181if (RegexCharClass.CharInClass((char)(ordinalCaseInsensitivePrefix[0] | 0x20), firstChild.Str!) || 1182RegexCharClass.CharInClass((char)(ordinalCaseInsensitivePrefix[0] & ~0x20), firstChild.Str!)) 1187else if (RegexCharClass.CharInClass(ordinalCaseInsensitivePrefix[0], firstChild.Str!)) 1208!RegexCharClass.IsNegated(nextChild.Str!) && 1212chars = chars.Slice(0, RegexCharClass.GetSetChars(nextChild.Str!, chars)); 1217if (RegexCharClass.CharInClass(c, firstChild.Str!))
System\Text\RegularExpressions\RegexReplacement.cs (1)
54vsb.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;