2 writes to Index
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Capture.cs (1)
15Index = index;
System\Text\RegularExpressions\Match.cs (1)
283Index = interval[0] + beginningOfSpanSlice; // the index of the match, adjusted for input slicing
84 references to Index
Aspire.Dashboard (6)
ConsoleLogs\UrlParser.cs (4)
29if (urlMatch.Index > 0) 31AppendNonMatchFragment(builder, nonMatchFragmentCallback, text[(nextCharIndex)..urlMatch.Index]); 34var urlStart = urlMatch.Index; 35nextCharIndex = urlMatch.Index + urlMatch.Length;
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22if (match.Index + match.Length >= span.Length) 28content = span[(match.Index + match.Length)..];
Aspire.Hosting (2)
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22if (match.Index + match.Length >= span.Length) 28content = span[(match.Index + match.Length)..];
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.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
79matches.Add((namedSpanStartMatch.Index, namedSpanStartMatch.Value));
Microsoft.Build.Tasks.UnitTests (2)
ResourceHandling\GenerateResource_Tests.cs (2)
3777string segment = unformattedMessage.Substring(i, match.Index - i); 3781i = match.Index + match.Length;
Microsoft.CodeAnalysis (1)
SourceGeneration\AdditionalSourcesCollection.cs (1)
72throw new ArgumentException(string.Format(CodeAnalysisResources.HintNameInvalidSegment, hintName, match.Value, match.Index), nameof(hintName));
Microsoft.CodeAnalysis.CodeStyle (1)
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.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\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.CSharp.Symbol.UnitTests (3)
Compilation\SemanticModelAPITests.cs (3)
4031var discarded = model.GetEnclosingSymbol(match.Index); 4059var x = tree.GetRoot().FindToken(match.Index + 4).Parent; 4060var discarded = model.GetEnclosingSymbol(match.Index);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\CSharp\Portable\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\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
355formatStringPosition + match.Index,
Microsoft.CodeAnalysis.Features.Test.Utilities (7)
EditAndContinue\SourceMarkers.cs (7)
65tagMap.Add(id, (match.Index, match.Index)); 69tagMap.Add(id, (match.Index + match.Length, -1)); 73tagMap[id] = (tagMap[id].start, match.Index); 103result.Add((id, new TextSpan(span.Index, span.Length))); 129var regionText = plainSource.AsSpan().Slice(exceptionRegion.Index, exceptionRegion.Length); 133result[activeStatementId][exceptionRegionId] = new TextSpan(exceptionRegion.Index + start, length);
Microsoft.CodeAnalysis.Test.Utilities (4)
Diagnostics\DiagnosticsHelper.cs (1)
22return new TextSpan(match.Index, match.Length);
MarkedSource\MarkupTestFile.cs (1)
81matches.Add((namedSpanStartMatch.Index, namedSpanStartMatch.Value));
MarkedSource\SourceWithMarkedNodes.cs (2)
64int absoluteOffset = offset + markedSyntax.Index; 66yield return new MarkedSpan(new TextSpan(absoluteOffset, markedSyntax.Length), new TextSpan(match.Index, match.Length), tagName.Value, parsedKind, id, parentId);
Microsoft.CodeAnalysis.Workspaces (1)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
420var 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.DotNet.VersionTools (2)
Dependencies\FileRegexUpdater.cs (2)
77int startIndex = group.Index - m.Index;
Microsoft.DotNet.VersionTools.Tasks (2)
UpdateToRemoteDependencies.cs (2)
114.Remove(g.Index, g.Length) 115.Insert(g.Index, newValue);
Microsoft.ML.Tokenizers (1)
PreTokenizer\PreTokenizer.cs (1)
169match = (m.Index, m.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
System.Private.Xml (3)
System\Xml\XmlConvert.cs (3)
196matchPos = m.Index - 1; 229matchPos = m.Index - 1; 244matchPos = m.Index - 1;
System.Text.RegularExpressions (23)
System\Text\RegularExpressions\Capture.cs (5)
30public string Value => Text is string text ? text.Substring(Index, Length) : string.Empty; 34public ReadOnlySpan<char> ValueSpan => Text is string text ? text.AsSpan(Index, Length) : []; 40internal ReadOnlyMemory<char> GetLeftSubstring() => Text is string text ? text.AsMemory(0, Index) : ReadOnlyMemory<char>.Empty; 43internal ReadOnlyMemory<char> GetRightSubstring() => Text is string text ? text.AsMemory(Index + Length, Text.Length - Index - Length) : ReadOnlyMemory<char>.Empty;
System\Text\RegularExpressions\Regex.cs (1)
509return (true, match.Index, match.Length, match._textpos);
System\Text\RegularExpressions\Regex.Replace.cs (5)
181state.segments.Add(state.input.AsMemory(state.prevat, match.Index - state.prevat)); 182state.prevat = match.Index + match.Length; 200state.segments.Add(state.input.AsMemory(match.Index + match.Length, state.prevat - match.Index - match.Length)); 201state.prevat = match.Index;
System\Text\RegularExpressions\Regex.Split.cs (5)
95state.results.Add(state.input.Substring(state.prevat, match.Index - state.prevat)); 96state.prevat = match.Index + match.Length; 123state.results.Add(state.input.Substring(match.Index + match.Length, state.prevat - match.Index - match.Length)); 124state.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;
xunit.assert (4)
StringAsserts.cs (4)
544 var formattedActual = AssertHelper.ShortenAndEncodeString(actualString, match.Index, out pointerIndent); 546 throw DoesNotMatchException.ForMatch(formattedExpected, match.Index, pointerIndent, formattedActual); 574 var formattedActual = AssertHelper.ShortenAndEncodeString(actualString, match.Index, out pointerIndent); 576 throw DoesNotMatchException.ForMatch(formattedExpected, match.Index, pointerIndent, formattedActual);