2 writes to Index
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Capture.cs (1)
30Index = index;
System\Text\RegularExpressions\Match.cs (1)
369Index = interval[0] + beginningOfSpanSlice; // the index of the match, adjusted for input slicing
82 references to Index
aspire (6)
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22if (match.Index + match.Length >= span.Length) 28content = span[(match.Index + match.Length)..];
src\Shared\ConsoleLogs\UrlParser.cs (4)
29if (urlMatch.Index > 0) 31AppendNonMatchFragment(builder, nonMatchFragmentCallback, text[(nextCharIndex)..urlMatch.Index]); 34var urlStart = urlMatch.Index; 35nextCharIndex = urlMatch.Index + urlMatch.Length;
Aspire.Dashboard (6)
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22if (match.Index + match.Length >= span.Length) 28content = span[(match.Index + match.Length)..];
src\Shared\ConsoleLogs\UrlParser.cs (4)
29if (urlMatch.Index > 0) 31AppendNonMatchFragment(builder, nonMatchFragmentCallback, text[(nextCharIndex)..urlMatch.Index]); 34var urlStart = urlMatch.Index; 35nextCharIndex = urlMatch.Index + urlMatch.Length;
Aspire.Hosting (2)
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22if (match.Index + match.Length >= span.Length) 28content = span[(match.Index + match.Length)..];
cdac-build-tool (2)
ContractDescriptorSourceFileEmitter.cs (2)
90dest.Write(template.AsSpan(prevPos, match.Index - prevPos)); 100prevPos = match.Index + match.Length;
dotnet-Microsoft.XmlSerializer.Generator (1)
Sgen.cs (1)
635int index = match.Index + 1;
dotnet-svcutil-lib (5)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (5)
116matchPos = m.Index; 126matchPos = m.Index; 222matchPos = m.Index - 1; 256matchPos = m.Index - 1; 274matchPos = m.Index - 1;
Microsoft.Build (8)
Evaluation\Expander.cs (8)
3430Index = match.Index; 3606if (match.Index != prevat) 3608stringBuilder.Append(input, prevat, match.Index - prevat); 3611prevat = match.Index + match.Length; 3632if (match.Index + match.Length != prevat) 3634list.Add(input.AsMemory().Slice(match.Index + match.Length, prevat - match.Index - match.Length)); 3637prevat = match.Index;
Microsoft.CodeAnalysis (1)
SourceGeneration\AdditionalSourcesCollection.cs (1)
80throw new ArgumentException(string.Format(CodeAnalysisResources.HintNameInvalidSegment, hintName, match.Value, match.Index), nameof(hintName));
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
355formatStringPosition + match.Index,
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
217if (s_fileTypeOrdinalPattern.Match(generatedName) is Match { Success: true, Groups: var groups, Index: var index, Length: var length })
Microsoft.CodeAnalysis.Features (1)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
355formatStringPosition + match.Index,
Microsoft.CodeAnalysis.Workspaces (3)
PatternMatching\RegexPatternMatcher.cs (2)
71var kind = bestMatch.Length == candidate.Length && bestMatch.Index == 0 75var matchedSpan = GetMatchedSpan(bestMatch.Index, bestMatch.Length);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
436var start = renameStringPosition + match.Index;
Microsoft.Data.Analysis (4)
TextFieldParser.cs (4)
87Limit = delimiterMatch.Index - 1; 795index = matchResult.Index + matchResult.Length; 856field = line.Substring(index, delimiterMatch.Index - index); 862index = delimiterMatch.Index + delimiterMatch.Length;
Microsoft.Data.Analysis.Tests (4)
src\Microsoft.Data.Analysis\TextFieldParser.cs (4)
87Limit = delimiterMatch.Index - 1; 795index = matchResult.Index + matchResult.Length; 856field = line.Substring(index, delimiterMatch.Index - index); 862index = delimiterMatch.Index + delimiterMatch.Length;
Microsoft.VisualBasic.Core (4)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (4)
911Index = MatchResult.Index + MatchResult.Length 971Field = Line.Substring(Index, DelimiterMatch.Index - Index) 980Index = DelimiterMatch.Index + DelimiterMatch.Length 1651Limit = DelimiterMatch.Index - 1
Microsoft.Web.XmlTransform (6)
XmlTransforms.cs (6)
391position = match.Index + match.Length; 408strbuilder.Append(transformValue.Substring(position, match.Index - position)); 423position = match.Index + match.Length; 529position = match.Index + match.Length; 546strbuilder.Append(transformValue.Substring(position, match.Index - position)); 616position = match.Index + match.Length;
System.Private.Xml (3)
System\Xml\XmlConvert.cs (3)
196matchPos = m.Index - 1; 229matchPos = m.Index - 1; 244matchPos = m.Index - 1;
System.Text.RegularExpressions (24)
System\Text\RegularExpressions\Capture.cs (5)
55public string Value => Text is string text ? text.Substring(Index, Length) : string.Empty; 59public ReadOnlySpan<char> ValueSpan => Text is string text ? text.AsSpan(Index, Length) : []; 72internal ReadOnlyMemory<char> GetLeftSubstring() => Text is string text ? text.AsMemory(0, Index) : ReadOnlyMemory<char>.Empty; 75internal ReadOnlyMemory<char> GetRightSubstring() => Text is string text ? text.AsMemory(Index + Length, Text.Length - Index - Length) : ReadOnlyMemory<char>.Empty;
System\Text\RegularExpressions\Match.cs (1)
31/// substring, the <see cref="Capture.Index"/> property indicates the zero-based starting position of
System\Text\RegularExpressions\Regex.cs (1)
661return (true, match.Index, match.Length, match._textpos);
System\Text\RegularExpressions\Regex.Replace.cs (5)
636state.segments.Add(state.input.AsMemory(state.prevat, match.Index - state.prevat)); 637state.prevat = match.Index + match.Length; 655state.segments.Add(state.input.AsMemory(match.Index + match.Length, state.prevat - match.Index - match.Length)); 656state.prevat = match.Index;
System\Text\RegularExpressions\Regex.Split.cs (5)
301state.results.Add(state.input.Substring(state.prevat, match.Index - state.prevat)); 302state.prevat = match.Index + match.Length; 329state.results.Add(state.input.Substring(match.Index + match.Length, state.prevat - match.Index - match.Length)); 330state.prevat = match.Index;
System\Text\RegularExpressions\RegexReplacement.cs (7)
239state.segments.Add(match.Index - state.prevat); 242state.prevat = match.Index + match.Length; 304state.segments.Add(state.inputMemory.Slice(state.prevat, match.Index - state.prevat)); 305state.prevat = match.Index + match.Length; 324state.segments.Add(state.inputMemory.Slice(match.Index + match.Length, state.prevat - match.Index - match.Length)); 325state.prevat = match.Index;