108 references to Escape
AnalyzeCiFailure (8)
AnalysisPublisher.cs (3)
177if (linked is not null && Regex.IsMatch(linked, $@"^https://github\.com/{Regex.Escape(_repository)}/issues/[1-9][0-9]*\z")) 611? "^" + Regex.Escape(destination!).Replace("/pull/", "/(?:pull|issues)/", StringComparison.Ordinal) + 613: "^" + Regex.Escape($"https://github.com/{_repository}/issues/{id.ToString(System.Globalization.CultureInfo.InvariantCulture)}") + @"\z";
AnalysisPublisher.Overflow.cs (1)
104issueUrl, "^" + System.Text.RegularExpressions.Regex.Escape($"https://github.com/{_repository}/issues/") + @"[1-9][0-9]*\z"))
CauseHistoryStore.cs (1)
36.Any(line => Regex.IsMatch(line, @"^[0-9a-fA-F]{40,64}\trefs/heads/" + Regex.Escape(BranchName) + @"\z")))
CauseIssueRenderer.cs (1)
371=> Regex.Matches(body, "^" + Regex.Escape(marker) + @"(?=\r?$)", RegexOptions.Multiline | RegexOptions.CultureInvariant);
OverflowIssueRenderer.cs (2)
50var starts = Regex.Matches(existing, "^" + Regex.Escape(Start) + @"\r?$", RegexOptions.Multiline | RegexOptions.CultureInvariant); 51var ends = Regex.Matches(existing, "^" + Regex.Escape(End) + @"\r?$", RegexOptions.Multiline | RegexOptions.CultureInvariant);
Aspire.Cli.Tests (2)
Agents\AgentTelemetryHookTests.cs (1)
369var pattern = Regex.Escape(glob)
Utils\TerminalLinkAssert.cs (1)
18var escapedLink = Regex.Escape(link);
Aspire.Dashboard (2)
Components\Layout\MobileNavMenu.razor.cs (1)
207.Select(Regex.Escape)
Components\Legacy\Layout\LegacyMobileNavMenu.razor.cs (1)
235pageRelativeBasePath = Regex.Escape(pageRelativeBasePath);
Aspire.Dashboard.Playwright.Tests (6)
Integration\Playwright\ResourcePanelNavigationTests.cs (2)
169await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex(System.Text.RegularExpressions.Regex.Escape(expectedDestination) + "$")); 414await Assertions.Expect(link).ToHaveAttributeAsync("aria-description", new System.Text.RegularExpressions.Regex(System.Text.RegularExpressions.Regex.Escape(reason)));
Integration\Playwright\ResourcePaneResponsiveTests.cs (3)
1439await Assertions.Expect(page).ToHaveURLAsync(new Regex($"^{Regex.Escape(expected.AbsoluteUri)}$")); 1899await Assertions.Expect(page).ToHaveURLAsync(new Regex($"{Regex.Escape(target)}$")); 1921await Assertions.Expect(page).ToHaveURLAsync(new Regex($"{Regex.Escape(nextTarget)}$"));
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Dashboard.Tests (1)
Markdown\MarkdownProcessorTests.cs (1)
43var count = Regex.Matches(html, Regex.Escape("code-block")).Count;
Aspire.EndToEnd.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Hosting.CodeGeneration.Go.Tests (3)
AtsGoCodeGeneratorTests.cs (2)
2538$@"if {Regex.Escape(nilGuard)} \{{\s+reqArgs\[""{parameterName}""\] = serializeValue\({parameterName}\)\s+\}}", 2749Assert.Matches($@"{name}\s+{Regex.Escape(expectedType)}\b", aspireGo);
GoDocCommentTests.cs (1)
176if (!Regex.IsMatch(lines[first].Trim(), $"^// {Regex.Escape(name)}(?:[ ,.:]|$)"))
Aspire.Hosting.CodeGeneration.Java.Tests (1)
AtsJavaCodeGeneratorTests.cs (1)
490if (!Regex.IsMatch(body, $@"\b{Regex.Escape(simpleName)}\b"))
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
AtsTypeScriptCodeGeneratorTests.cs (1)
2656var match = Regex.Match(code, $@"^export interface {Regex.Escape(name)} \{{.*?^\}}", RegexOptions.Multiline | RegexOptions.Singleline);
Aspire.Hosting.Kubernetes.Tests (4)
KubernetesIngressTests.cs (1)
122new System.Text.RegularExpressions.Regex(@"parameters:\s*[\r\n]+\s*public:\s*[\r\n]+\s*" + System.Text.RegularExpressions.Regex.Escape(parameterName) + @"\s*:"),
KubernetesPublisherTests.cs (3)
2994System.Text.RegularExpressions.Regex.Escape(storageClassName) + @"\s*:"); 2998System.Text.RegularExpressions.Regex.Escape(capacityName) + @"\s*:"), 3002System.Text.RegularExpressions.Regex.Escape(backupTierName) + @"\s*:"),
Aspire.Hosting.RemoteHost (2)
Ats\PolyglotCapabilityInvocationException.cs (2)
523$@"\b{Regex.Escape(clrMemberName)}\b", 536$@"\b{Regex.Escape(alias.Key)}\b",
Aspire.Hosting.RemoteHost.Tests (2)
CodeGeneration\ApiReferenceExportTests.cs (2)
52$@"^(export (interface|enum|namespace) |function ){Regex.Escape(item.GetProperty("name").GetString()!)}\b", 195$@"^(type|var|func) {Regex.Escape(item.GetProperty("name").GetString()!)}\b",
Aspire.Hosting.Testing.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Playground.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Templates.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
GenerateTemplateManifest (1)
TemplateRestorePlan.cs (1)
104(Regex.IsMatch(relevant, $@"\b{Regex.Escape(name)}\b") ||
Infrastructure.Tests (1)
MicrosoftTestingPlatformTests.cs (1)
86Assert.Matches($@"(?m)^\s+{Regex.Escape(option)}\s*$", result.Output);
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (1)
28var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
Internal\JsonTranscodingRouteAdapter.cs (2)
122var constraint = suffix.Length > 0 ? $":regex({Regex.Escape(suffix)}$)" : string.Empty; 184tempSegments[i] = $"{{**__Discard_{i}:regex({Regex.Escape($":{pattern.Verb}")}$)}}";
Microsoft.Build (3)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
250sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 360sb.Append(Regex.Escape(currentChar.ToString()));
Definition\ToolsetReader.cs (1)
208var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (2)
257sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 367sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.Features (1)
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (1)
27var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
Microsoft.Data.Analysis (1)
TextFieldParser.cs (1)
1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.Data.Analysis.Tests (1)
parent\parent\src\Microsoft.Data.Analysis\TextFieldParser.cs (1)
1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.DotNet.Build.Tasks.Workloads (1)
Utils.cs (1)
112string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
373return Regex.Escape(Path.DirectorySeparatorChar.ToString());
Microsoft.DotNet.SourceBuild.Tasks (1)
src\UsageReport\UsagePattern.cs (1)
36string regex = Regex.Escape(IdentityGlob).Replace("\\*", ".*");
Microsoft.Extensions.AI.Evaluation (8)
Utilities\ModelInfo.cs (8)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Console (8)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (8)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Reporting (8)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (8)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Safety (8)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (8)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Emitter\CoreBindingHelpers.cs (1)
21private static readonly Regex s_arrayBracketsRegex = new(Regex.Escape("[]"));
Microsoft.Maui.Controls (1)
WebView\WebView.cs (1)
324 js = Regex.Replace(js, @"(?<=[^\\])" + Regex.Escape(match), replacementStr);
Microsoft.ML.CodeGenerator (3)
Templates\Azure\Console\AzureModelBuilder.cs (1)
59this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Templates\Console\ModelBuilder.cs (2)
65this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString()))); 77this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Microsoft.ML.Tokenizers (4)
Model\SentencePieceBaseModel.cs (2)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 97SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Microsoft.NET.Build.Containers (1)
ReferenceParser.cs (1)
297private static string literal(string s) => Regex.Escape(s);
Microsoft.NET.Sdk.Publish.Tasks (3)
MsDeploy\VSMSDeployHostObject.cs (2)
54srcSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(Path.Combine(rootFolderOfFileToPublish, p.SourceFilePath)) + "$"); 63destSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(p.DestinationFilePath) + "$");
Tasks\MsDeploy\CreateParameterFile.cs (1)
163metadataValue = $"^{Regex.Escape(metadataValue)}$";
Microsoft.TemplateEngine.Cli (1)
TemplateInvoker.cs (1)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (1)
Mount\Archive\ZipFileDirectory.cs (1)
23string rx = Regex.Escape(pattern);
Microsoft.TemplateEngine.Utils (3)
InMemoryFileSystem.cs (3)
196Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 276Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 358Regex rx = new("^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$");
NuGet.Common (1)
PathUtil\PathResolver.cs (1)
75string pattern = Regex.Escape(wildcard);
NuGet.Configuration (1)
Proxy\WebProxy.cs (1)
90return Regex.Escape(pattern)
SelectTests (2)
TriggerMap.cs (2)
165var regex = "^" + Regex.Escape(before) + "([^/]+)" + Regex.Escape(after) + (hasGlobSuffix ? "/.+" : "") + "$";
System.Text.RegularExpressions (2)
System\Text\RegularExpressions\Regex.cs (2)
360/// <see cref="Escape" /> converts a string so that the regular expression engine will interpret any 390/// <see cref="Escape" /> method by removing the escape character ("\") from each escaped character.