2 writes to Index
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Capture.cs (1)
15
Index
= index;
System\Text\RegularExpressions\Match.cs (1)
283
Index
= interval[0] + beginningOfSpanSlice; // the index of the match, adjusted for input slicing
80 references to Index
Aspire.Dashboard (6)
ConsoleLogs\UrlParser.cs (4)
29
if (urlMatch.
Index
> 0)
31
AppendNonMatchFragment(builder, nonMatchFragmentCallback, text[(nextCharIndex)..urlMatch.
Index
]);
34
var urlStart = urlMatch.
Index
;
35
nextCharIndex = urlMatch.
Index
+ urlMatch.Length;
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22
if (match.
Index
+ match.Length >= span.Length)
28
content = span[(match.
Index
+ match.Length)..];
Aspire.Hosting (2)
src\Shared\ConsoleLogs\TimestampParser.cs (2)
22
if (match.
Index
+ match.Length >= span.Length)
28
content = span[(match.
Index
+ match.Length)..];
dotnet-svcutil-lib (5)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (5)
116
matchPos = m.
Index
;
126
matchPos = m.
Index
;
222
matchPos = m.
Index
- 1;
256
matchPos = m.
Index
- 1;
274
matchPos = m.
Index
- 1;
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
79
matches.Add((namedSpanStartMatch.
Index
, namedSpanStartMatch.Value));
Microsoft.Build.Tasks.UnitTests (2)
ResourceHandling\GenerateResource_Tests.cs (2)
3775
string segment = unformattedMessage.Substring(i, match.
Index
- i);
3779
i = match.
Index
+ match.Length;
Microsoft.CodeAnalysis (1)
SourceGeneration\AdditionalSourcesCollection.cs (1)
72
throw 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)
355
formatStringPosition + match.
Index
,
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
217
if (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)
217
if (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)
4062
var discarded = model.GetEnclosingSymbol(match.
Index
);
4090
var x = tree.GetRoot().FindToken(match.
Index
+ 4).Parent;
4091
var discarded = model.GetEnclosingSymbol(match.
Index
);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
217
if (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)
355
formatStringPosition + match.
Index
,
Microsoft.CodeAnalysis.Features.Test.Utilities (7)
EditAndContinue\SourceMarkers.cs (7)
65
tagMap.Add(id, (match.
Index
, match.
Index
));
69
tagMap.Add(id, (match.
Index
+ match.Length, -1));
73
tagMap[id] = (tagMap[id].start, match.
Index
);
103
result.Add((id, new TextSpan(span.
Index
, span.Length)));
129
var regionText = plainSource.AsSpan().Slice(exceptionRegion.
Index
, exceptionRegion.Length);
133
result[activeStatementId][exceptionRegionId] = new TextSpan(exceptionRegion.
Index
+ start, length);
Microsoft.CodeAnalysis.Test.Utilities (4)
Diagnostics\DiagnosticsHelper.cs (1)
22
return new TextSpan(match.
Index
, match.Length);
MarkedSource\MarkupTestFile.cs (1)
81
matches.Add((namedSpanStartMatch.
Index
, namedSpanStartMatch.Value));
MarkedSource\SourceWithMarkedNodes.cs (2)
64
int absoluteOffset = offset + markedSyntax.
Index
;
66
yield 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)
420
var start = renameStringPosition + match.
Index
;
Microsoft.Data.Analysis (4)
TextFieldParser.cs (4)
87
Limit = delimiterMatch.
Index
- 1;
795
index = matchResult.
Index
+ matchResult.Length;
856
field = line.Substring(index, delimiterMatch.
Index
- index);
862
index = delimiterMatch.
Index
+ delimiterMatch.Length;
Microsoft.Data.Analysis.Tests (4)
src\Microsoft.Data.Analysis\TextFieldParser.cs (4)
87
Limit = delimiterMatch.
Index
- 1;
795
index = matchResult.
Index
+ matchResult.Length;
856
field = line.Substring(index, delimiterMatch.
Index
- index);
862
index = delimiterMatch.
Index
+ delimiterMatch.Length;
Microsoft.ML.Tokenizers (1)
PreTokenizer\PreTokenizer.cs (1)
169
match = (m.
Index
, m.Length);
Microsoft.VisualBasic.Core (4)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (4)
911
Index = MatchResult.
Index
+ MatchResult.Length
971
Field = Line.Substring(Index, DelimiterMatch.
Index
- Index)
980
Index = DelimiterMatch.
Index
+ DelimiterMatch.Length
1651
Limit = DelimiterMatch.
Index
- 1
System.Private.Xml (3)
System\Xml\XmlConvert.cs (3)
196
matchPos = m.
Index
- 1;
229
matchPos = m.
Index
- 1;
244
matchPos = m.
Index
- 1;
System.Text.RegularExpressions (23)
System\Text\RegularExpressions\Capture.cs (5)
30
public string Value => Text is string text ? text.Substring(
Index
, Length) : string.Empty;
34
public ReadOnlySpan<char> ValueSpan => Text is string text ? text.AsSpan(
Index
, Length) : [];
40
internal ReadOnlyMemory<char> GetLeftSubstring() => Text is string text ? text.AsMemory(0,
Index
) : ReadOnlyMemory<char>.Empty;
43
internal ReadOnlyMemory<char> GetRightSubstring() => Text is string text ? text.AsMemory(
Index
+ Length, Text.Length -
Index
- Length) : ReadOnlyMemory<char>.Empty;
System\Text\RegularExpressions\Regex.cs (1)
509
return (true, match.
Index
, match.Length, match._textpos);
System\Text\RegularExpressions\Regex.Replace.cs (5)
181
state.segments.Add(state.input.AsMemory(state.prevat, match.
Index
- state.prevat));
182
state.prevat = match.
Index
+ match.Length;
200
state.segments.Add(state.input.AsMemory(match.
Index
+ match.Length, state.prevat - match.
Index
- match.Length));
201
state.prevat = match.
Index
;
System\Text\RegularExpressions\Regex.Split.cs (5)
95
state.results.Add(state.input.Substring(state.prevat, match.
Index
- state.prevat));
96
state.prevat = match.
Index
+ match.Length;
123
state.results.Add(state.input.Substring(match.
Index
+ match.Length, state.prevat - match.
Index
- match.Length));
124
state.prevat = match.
Index
;
System\Text\RegularExpressions\RegexReplacement.cs (7)
239
state.segments.Add(match.
Index
- state.prevat);
242
state.prevat = match.
Index
+ match.Length;
304
state.segments.Add(state.inputMemory.Slice(state.prevat, match.
Index
- state.prevat));
305
state.prevat = match.
Index
+ match.Length;
324
state.segments.Add(state.inputMemory.Slice(match.
Index
+ match.Length, state.prevat - match.
Index
- match.Length));
325
state.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);