93 types derived from Regex
cdac-build-tool (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (2)
62file sealed class FindTemplatePlaceholderRegex_0 : Regex 204file sealed class CStringEscape_1 : Regex
dotnet-aot (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (2)
74file sealed class GetFrameRegex_0 : Regex 453file sealed class GetInvalidJsonBackslashRegex_1 : Regex
dotnet-dev-certs (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
illink (2)
Microsoft.AspNetCore.Authentication.Negotiate (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
40file sealed class DistinguishedNameSeparatorRegex_0 : Regex
Microsoft.AspNetCore.Components (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Microsoft.AspNetCore.Routing (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
89file sealed class OpenSslVersionRegex_0 : Regex 250file sealed class OpenSslHashFilenameRegex_1 : Regex 383file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Microsoft.Build (13)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (13)
561file sealed class SectionMatcherRegex_0 : Regex 976file sealed class PropertyMatcherRegex_1 : Regex 1420file sealed class TerminalLoggerArgPattern_2 : Regex 1722file sealed class VerbosityArgPattern_3 : Regex 1967file sealed class TerminalLoggerParametersArgPattern_4 : Regex 2205file sealed class ConsoleLoggerParametersArgPattern_5 : Regex 2443file sealed class ItemVectorTransformRegex_6 : Regex 2837file sealed class ItemVectorTransformRawRegex_7 : Regex 3149file sealed class XmlDeclarationRegex_8 : Regex 3357file sealed class CrackProjectLineRegex_9 : Regex 3827file sealed class CrackPropertyLineRegex_10 : Regex 4094file sealed class RegistrySdkRegex_11 : Regex 4265file sealed class XmlnsPattern_12 : Regex
Microsoft.Build.Framework (9)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (9)
354file sealed class CommandLineNodeModeRegex_0 : Regex 690file sealed class OriginCategoryCodeTextExpression_1 : Regex 1543file sealed class OriginCategoryCodeTextExpression2_2 : Regex 1901file sealed class FilenameLocationFromOrigin_3 : Regex 2198file sealed class LineFromLocation_4 : Regex 2320file sealed class LineLineFromLocation_5 : Regex 2475file sealed class LineColFromLocation_6 : Regex 2630file sealed class LineColColFromLocation_7 : Regex 2814file sealed class LineColLineColFromLocation_8 : Regex
Microsoft.Build.Tasks.Core (5)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (5)
179file sealed class MsbuildMessageCodePattern_0 : Regex 297file sealed class PlatformMonikerRegex_1 : Regex 465file sealed class AssemblyNameRegex_2 : Regex 1170file sealed class AssemblyVersionRegex_3 : Regex 1368file sealed class SdkReferenceFormatRegex_4 : Regex
Microsoft.CodeAnalysis (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (2)
85file sealed class GetSectionMatcherRegex_0 : Regex 500file sealed class GetPropertyMatcherRegex_1 : Regex
Microsoft.DotNet.Cli.Definitions (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
107file sealed class TimeoutPattern_0 : Regex
Microsoft.DotNet.Cli.InternalMicrosoft (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
125file sealed class AliasRegex_0 : Regex 233file sealed class GitHubTokenRegex_1 : Regex 430file sealed class GitHubTokenValueRegex_2 : Regex
Microsoft.DotNet.HotReload.Watch (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
92file sealed class GetNowListeningOnRegex_0 : Regex 271file sealed class GetAspireDashboardUrlRegex_1 : Regex 450file sealed class GetBuildDiagnosticRegex_2 : Regex
Microsoft.DotNet.ProjectTools (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
40file sealed class MSBuildPropertyRegex_0 : Regex
Microsoft.ML.Tokenizers (6)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (6)
229file sealed class Cl100kBaseRegex_0 : Regex 679file sealed class P50kBaseRegex_1 : Regex 1053file sealed class O200kBaseRegex_2 : Regex 1888file sealed class WhiteSpaceOrPunctuationRegex_3 : Regex 2018file sealed class WordOrNonWordRegex_4 : Regex 2151file sealed class WhiteSpaceRegex_5 : Regex
Microsoft.NET.Build.Containers (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
44file sealed class BearerParameterSplitter_0 : Regex
RepoTasks (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
sdk-tasks (2)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (2)
80file sealed class FeatureBandRegex_0 : Regex 320file sealed class VersionRegex_1 : Regex
System.ComponentModel.TypeConverter (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
39file sealed class ParameterReplacementRegex_0 : Regex
System.Data.Common (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Data.Odbc (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Data.OleDb (3)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Private.DataContractSerialization (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
193file sealed class FullSRSInternalsVisibleRegex_0 : Regex
System.Private.Xml (12)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (12)
305file sealed class DecodeCharRegex_0 : Regex 438file sealed class EncodeCharRegex_1 : Regex 597file sealed class LanguageRegex_2 : Regex 781file sealed class Regex1_3 : Regex 1071file sealed class Regex2_4 : Regex 1250file sealed class EnsureArrayIndexRegex_5 : Regex 1595file sealed class P0Regex_6 : Regex 1800file sealed class UnknownNodeNullAnyTypeRegex_7 : Regex 1938file sealed class UnknownNodeObjectEmptyRegex_8 : Regex 2111file sealed class UnknownNodeObjectNullRegex_9 : Regex 2255file sealed class UnknownNodeObjectRegex_10 : Regex 2399file sealed class ParamsReadRegex_11 : Regex
System.Text.Json (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
42file sealed class IntegerRegex_0 : Regex
System.Windows.Forms (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
37file sealed class ContiguousNonWhitespace_0 : Regex
System.Windows.Forms.Design (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
58file sealed class SanitizeNameRegex_0 : Regex
397 instantiations of Regex
Aspire.Acquisition.Tests (1)
Scripts\LocalHiveScriptFunctionTests.cs (1)
31var userEnvironmentWrite = new System.Text.RegularExpressions.Regex(
Aspire.Cli.EndToEnd.Tests (4)
CentralPackageManagementTests.cs (1)
385var packageDirectiveRegex = new Regex(
Helpers\CliE2ETestHelpers.cs (3)
34private static readonly Regex s_commitShaPattern = new("^[0-9a-fA-F]{40}$", RegexOptions.Compiled); 1134var stablePackageRegex = new Regex(@"^Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase); 1170var stablePackageRegex = new Regex(@"^(?:\./)?hives/local/packages/Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase);
Aspire.Dashboard (3)
Components\Layout\MobileNavMenu.razor.cs (1)
209return new Regex($"^({string.Join("|", alternatives)})$", LinkMatchRegexOptions);
Components\Legacy\Layout\LegacyMobileNavMenu.razor.cs (2)
236return new Regex($"^({pageRelativeBasePath}(\\?.*)?|{pageRelativeBasePath}/.+)$", LinkMatchRegexOptions); 241private static readonly Regex s_resourcesPageRegex = new($"^{LegacyNavUrls.BasePath}(/|/resources/?)?(\\?.*)?$", LinkMatchRegexOptions);
Aspire.Dashboard.Playwright.Tests (70)
Integration\Playwright\DesktopNavMenuTests.cs (4)
78await Assertions.Expect(layout).Not.ToHaveClassAsync(new Regex("pane-collapsed")); 81await Assertions.Expect(layout).ToHaveClassAsync(new Regex("pane-collapsed")); 84await Assertions.Expect(layout).ToHaveClassAsync(new Regex("pane-collapsed")); 87await Assertions.Expect(layout).Not.ToHaveClassAsync(new Regex("pane-collapsed"));
Integration\Playwright\ResourcePaneFullCanvasTests.cs (9)
133await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/resources$")); 195await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/consolelogs$")); 203await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/consolelogs/resource/tag-b$")); 205await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/resources/tag-b$")); 262await Assertions.Expect(page).ToHaveURLAsync(new Regex("/consolelogs$")); 268await Assertions.Expect(page).ToHaveURLAsync(new Regex("/consolelogs$")); 282await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources$")); 335await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources$")); 348await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources/tag-a$"));
Integration\Playwright\ResourcePaneInteractionTests.cs (10)
48var telemetrySection = pane.Locator("button.resource-pane-section-header", new() { HasTextRegex = new Regex("^Telemetry sources") }); 64await Assertions.Expect(page).ToHaveURLAsync(new Regex($"/structuredlogs/resource/{resourceName}$")); 103await Assertions.Expect(page).ToHaveURLAsync(new Regex("/consolelogs$")); 109await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources$")); 213await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources$")); 290var telemetrySection = pane.Locator("button.resource-pane-section-header", new() { HasTextRegex = new Regex("^Telemetry sources") }); 299await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/structuredlogs\?resource=multi-a&resource=multi-c$")); 314await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/structuredlogs\?resource=multi-a&resource=multi-b&resource=multi-c$")); 343await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/structuredlogs\?resource=multi-a&resource=multi-c$")); 346await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/structuredlogs/resource/multi-b$"));
Integration\Playwright\ResourcePanelNavigationTests.cs (18)
70await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/resources/tag-b$")); 83await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/resources$")); 169await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex(System.Text.RegularExpressions.Regex.Escape(expectedDestination) + "$")); 277await Assertions.Expect(row).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable")); 296await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex($"/{path}/resource/tag-a$")); 339await Assertions.Expect(row).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable")); 343await Assertions.Expect(row).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("selected")); 346await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex($"/{path}/resource/tag-a$")); 358await Assertions.Expect(row).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable")); 365await Assertions.Expect(row).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("selected")); 368await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex($"/{path}/resource/tag-a$")); 379await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex($"/{path}/resource/tag-b$")); 414await Assertions.Expect(link).ToHaveAttributeAsync("aria-description", new System.Text.RegularExpressions.Regex(System.Text.RegularExpressions.Regex.Escape(reason))); 425await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex("/resources/api-key$")); 432await Assertions.Expect(row).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable")); 485await Assertions.Expect(page).ToHaveURLAsync(new System.Text.RegularExpressions.Regex($"/{path}/resource/tag-a$")); 492await Assertions.Expect(row).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable")); 497await Assertions.Expect(row).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("resource-row-unavailable"));
Integration\Playwright\ResourcePaneMotionTests.cs (6)
488await Assertions.Expect(layout).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas")); 490await Assertions.Expect(layout).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas")); 492await Assertions.Expect(layout).ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas")); 494await Assertions.Expect(layout).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas|pane-motion-enabled")); 496await Assertions.Expect(layout).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas|pane-motion-enabled")); 498await Assertions.Expect(layout).Not.ToHaveClassAsync(new System.Text.RegularExpressions.Regex("pane-full-canvas|pane-motion-enabled"));
Integration\Playwright\ResourcePaneResponsiveTests.cs (9)
73await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/resources(?:\?.*)?$")); 850await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources$")); 1439await Assertions.Expect(page).ToHaveURLAsync(new Regex($"^{Regex.Escape(expected.AbsoluteUri)}$")); 1445.Filter(new() { HasTextRegex = new Regex(@"api: Test span\. Id: api-1\b") })).ToBeVisibleAsync(); 1450await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources/api$")); 1899await Assertions.Expect(page).ToHaveURLAsync(new Regex($"{Regex.Escape(target)}$")); 1921await Assertions.Expect(page).ToHaveURLAsync(new Regex($"{Regex.Escape(nextTarget)}$")); 1965await Assertions.Expect(row.Locator(".resource-row-link")).ToHaveAttributeAsync("aria-description", new System.Text.RegularExpressions.Regex("Unhealthy")); 2518await Assertions.Expect(api.Locator(".resource-row-link")).ToHaveAttributeAsync("aria-description", new System.Text.RegularExpressions.Regex("Unhealthy"));
Integration\Playwright\ResourcesTests.cs (3)
246await Assertions.Expect(layout).Not.ToHaveClassAsync(new Regex("drawer-open")); 249await Assertions.Expect(layout).ToHaveClassAsync(new Regex("drawer-open")); 260await Assertions.Expect(layout).Not.ToHaveClassAsync(new Regex("drawer-open"));
Integration\Playwright\ResourceTagPaneTests.cs (4)
42await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/resources\?resource=tag-a&resource=tag-c$")); 52await Assertions.Expect(page).ToHaveURLAsync(new Regex(@"/resources\?resource=tag-a&resource=tag-c$")); 61await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources/tag-a$")); 66await Assertions.Expect(page).ToHaveURLAsync(new Regex("/resources/tag-b$"));
Integration\Playwright\TerminalDockTests.cs (2)
115await Assertions.Expect(page.Locator(".terminal-dock")).ToHaveClassAsync(new Regex("visible")); 433await Assertions.Expect(page.Locator(".terminal-dock")).ToHaveClassAsync(new Regex("visible"));
Integration\Playwright\TerminalTests.cs (4)
49? new Regex("terminal-focused") 50: new Regex("^(?!.*terminal-focused)")); 79await Assertions.Expect(page).ToHaveURLAsync(new Regex($"/resources/{ResourceName}$")); 84await Assertions.Expect(overview).ToHaveClassAsync(new Regex("terminal-focused"));
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Dashboard.Tests (1)
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (3)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting.CodeGeneration.TypeScript.Tests (6)
AtsTypeScriptCodeGeneratorTests.cs (6)
1783new(@"\b(?:interface|class|type|const)\s+(\w*Promise(?:Impl)?)\b", RegexOptions.Compiled); 1788new(@"\b[A-Z]\w*Promise(?:Impl)?\b", RegexOptions.Compiled); 1791new(@"\b(?:interface|enum|type)\s+([A-Z]\w*)\b", RegexOptions.Compiled); 1794new(@"\b[A-Z]\w*\b", RegexOptions.Compiled); 1907new( 1915new(@"invokeCapability<(\w+)>\([^;]*?\);\s*return new (\w+)\(", RegexOptions.Compiled);
Aspire.Hosting.Foundry (2)
FoundryLocalService.cs (2)
22private static readonly Regex s_urlRegex = new(@"https?://\S+", RegexOptions.Compiled); 23private static readonly Regex s_progressRegex = new(@"(?<progress>\d+(?:\.\d+)?)\s*%", RegexOptions.Compiled);
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
29private static readonly Regex s_exportIdPattern = new(
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)
2992var parametersBlockRegex = new System.Text.RegularExpressions.Regex( 2997new System.Text.RegularExpressions.Regex(@"parameters:[\s\S]+data:[\s\S]+" + 3001new System.Text.RegularExpressions.Regex(@"parameters:[\s\S]+data:[\s\S]+" +
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 (2)
AppHostTests.cs (1)
52var regex = new Regex(wait.Pattern);
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Templates.Tests (3)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet-aot (17)
parent\dotnet\Commands\Test\MTP\Terminal\AnsiDetector.cs (17)
20new("^xterm"), // xterm, PuTTY, Mintty 21new("^rxvt"), // RXVT 22new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 23new("^screen"), // GNU screen, tmux 24new("tmux"), // tmux 25new("^vt100"), // DEC VT series 26new("^vt102"), // DEC VT series 27new("^vt220"), // DEC VT series 28new("^vt320"), // DEC VT series 29new("ansi"), // ANSI 30new("scoansi"), // SCO ANSI 31new("cygwin"), // Cygwin, MinGW 32new("linux"), // Linux console 33new("konsole"), // Konsole 34new("bvterm"), // Bitvise SSH Client 35new("^st-256color"), // Suckless Simple Terminal, st 36new("alacritty"), // Alacritty
dotnet-svcutil-lib (10)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
557new Regex(@"(^(.*)(\(([0-9]+),([0-9]+)\)): )(error|warning) ([A-Z]+[0-9]+) ?: (.*)"); 559new Regex(@"(error|warning) ([A-Z]+[0-9]+) ?: (.*)");
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (1)
543s_outputReg = new Regex(@"^([^(]*)\(?([0-9]*)\)? ?:? ?(error|warning) ([A-Z]+[0-9]+) ?: ((.|\n)*)");
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (2)
366_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString()), RegexOptions.None)); 1361Regex langRegex = new Regex("^([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*$", RegexOptions.None);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
75regex = new Regex(pattern);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
103s_decodeCharPattern = new Regex("_[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); 212s_encodeCharPattern = new Regex("(?<=_)[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_");
ILCompiler.Compiler (1)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
ILCompiler.ReadyToRun (1)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
illink (1)
Infrastructure.Tests (2)
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (2)
29private static readonly Regex s_standaloneLiteral = new( 36private static readonly Regex s_anyPartitionTrait = new(
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (1)
29_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
Microsoft.AspNetCore.Components (1)
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
DebugProxyLauncher.cs (3)
19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
parent\Shared\Legacy.cs (2)
52private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 61private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Rewrite (9)
ApacheModRewrite\RuleBuilder.cs (4)
68match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout), input.Invert); 72match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout), input.Invert); 165_match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout), input.Invert); 169_match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout), input.Invert);
IISUrlRewrite\UriMatchCondition.cs (1)
27var regex = new Regex(
IISUrlRewrite\UrlRewriteRuleBuilder.cs (2)
49var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout); 54var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
RedirectRule.cs (1)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
RewriteRule.cs (1)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
Microsoft.AspNetCore.Routing (1)
Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.SpaServices.Extensions (4)
AngularCli\AngularCliBuilder.cs (1)
70new Regex("Date", RegexOptions.None, RegexMatchTimeout));
AngularCli\AngularCliMiddleware.cs (1)
77new Regex("open your browser on (http\\S+)", RegexOptions.None, RegexMatchTimeout));
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
ReactDevelopmentServer\ReactDevelopmentServerMiddleware.cs (1)
91new Regex("Starting the development server", RegexOptions.None, RegexMatchTimeout));
Microsoft.Build (4)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
129manifest.ResolvableSdkRegex = new Regex(pattern, regexOptions, TimeSpan.FromMilliseconds(SdkResolverPatternRegexTimeoutMsc));
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
Definition\ToolsetReader.cs (1)
208var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Utilities\EngineFileUtilities.cs (1)
583Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Microsoft.Build.Framework (18)
Logging\AnsiDetector.cs (17)
18new("^xterm"), // xterm, PuTTY, Mintty 19new("^rxvt"), // RXVT 20new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 21new("^screen"), // GNU screen, tmux 22new("tmux"), // tmux 23new("^vt100"), // DEC VT series 24new("^vt102"), // DEC VT series 25new("^vt220"), // DEC VT series 26new("^vt320"), // DEC VT series 27new("ansi"), // ANSI 28new("scoansi"), // SCO ANSI 29new("cygwin"), // Cygwin, MinGW 30new("linux"), // Linux console 31new("konsole"), // Konsole 32new("bvterm"), // Bitvise SSH Client 33new("^st-256color"), // Suckless Simple Terminal, st 34new("alacritty"), // Alacritty
Telemetry\CrashTelemetry.cs (1)
173private static readonly Regex FilePathPattern = new(
Microsoft.Build.Tasks.CodeAnalysis (7)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (7)
54private static readonly Regex s_originCategoryCodeTextExpression = new Regex 76private static readonly Regex s_filenameLocationFromOrigin = new Regex(@" 88private static readonly Regex s_lineFromLocation = new Regex(@" 96private static readonly Regex s_lineLineFromLocation = new Regex(@" 106private static readonly Regex s_lineColFromLocation = new Regex(@" 116private static readonly Regex s_lineColColFromLocation = new Regex(@" 128private static readonly Regex s_lineColLineColFromLocation = new Regex(@"
Microsoft.Build.Tasks.Core (1)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
27() => new Regex(
Microsoft.Build.Utilities.Core (2)
CommandLineBuilder.cs (2)
158new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant); 164new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
127var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled));
SourceGeneration\AdditionalSourcesCollection.cs (1)
28private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.CodeAnalysis.Features (9)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr); 640else if (relativePath.IsEmpty() && new Regex(fileName).IsMatch(relativePath))
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (1)
28_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})(?!\w)((\s*,\s*)(?<option>[a-z]+))*",
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
208new(
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (2)
49private static readonly Regex s_AntiForgeryAttributeRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute$", RegexOptions.Compiled); 50private static readonly Regex s_AntiForgeryRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*$", RegexOptions.Compiled);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
AbstractResxGenerator.cs (2)
864private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 865private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (4)
PatternMatching\RegexPatternMatcher.cs (2)
44var caseInsensitive = new Regex(pattern, commonOptions | RegexOptions.IgnoreCase, timeout); 45var caseSensitive = new Regex(pattern, commonOptions, timeout);
Rename\RenameUtilities.cs (1)
330return new Regex(matchString, RegexOptions.CultureInvariant);
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (3)
TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.Data.Analysis.Tests (3)
parent\parent\src\Microsoft.Data.Analysis\TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (1)
34_patterns[i] = (new Regex(rawPatterns[i].CaptureGroupPattern, RegexOptions.Compiled), rawPatterns[i].ReplacementString);
Microsoft.DotNet.Arcade.Sdk (2)
src\GenerateResxSource.cs (2)
493private static readonly Regex _namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 494private static readonly Regex _numberParameterMatcher = new Regex(@"\{(\d+)\}", RegexOptions.Compiled);
Microsoft.DotNet.Build.Manifest (1)
BuildModelFactory.cs (1)
62private readonly Regex LegacyRepositoryUriPattern = new Regex(
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateWixBuildWixpack.cs (2)
250var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>"); 666var regex = new Regex(@"<\?include\s+([^\s\?>]+)\s*\?>", RegexOptions.IgnoreCase);
src\GenerateCurrentVersion.cs (1)
99Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.HotReload.Utils.Generator (1)
EditAndContinueCapabilitiesParser.cs (1)
12static public readonly Regex capabilitiesTokenizer = new (@"^\s*(?:(\S+)\s+)*(\S+)?$", RegexOptions.CultureInvariant);
Microsoft.DotNet.ProjectTools (2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\UsagePattern.cs (3)
30return new Regex(IdentityRegex, RegexOptions.IgnoreCase | RegexOptions.Compiled); 38return new Regex( 43return new Regex("");
src\WriteBuildOutputProps.cs (1)
19private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.Extensions.AI.Evaluation (2)
Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Console (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Reporting (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Safety (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Emitter\CoreBindingHelpers.cs (1)
21private static readonly Regex s_arrayBracketsRegex = new(Regex.Escape("[]"));
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Maui.Controls (1)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
13 = new Regex(@"^[a-z]([a-z0-9_]*[a-z0-9])?$", RegexOptions.Singleline | RegexOptions.Compiled);
Microsoft.ML.Core (1)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
338var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (12)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Evaluators\MulticlassClassificationEvaluator.cs (2)
134isVector: true, namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", LogLoss), RegexOptions.IgnoreCase), 1029namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", MulticlassClassificationEvaluator.LogLoss), RegexOptions.IgnoreCase));
Evaluators\MultiOutputRegressionEvaluator.cs (4)
82isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L1), RegexOptions.IgnoreCase), 85isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L2), RegexOptions.IgnoreCase), 88isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Rms), RegexOptions.IgnoreCase), 91isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Loss), RegexOptions.IgnoreCase),
Evaluators\RankingEvaluator.cs (3)
148namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Ndcg), RegexOptions.IgnoreCase), 151namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Dcg), RegexOptions.IgnoreCase), 154namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", MaxDcg), RegexOptions.IgnoreCase),
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
71Assert.Matches(new Regex(@"(\d+)\.(\d+)\.(\d+)(-[dev|ci|preview\.(\d+)\.(\d+)\.(\d+)]){0,1}"), line);
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tokenizers (5)
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);
Normalizer\SentencePieceNormalizationStep.cs (1)
444return new ReplaceStep(literal: null, new Regex(regexPattern, RegexOptions.CultureInvariant, _regexTimeout), content);
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.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
1101preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
Microsoft.NET.Build.Containers (16)
ContainerHelpers.cs (1)
37private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
DigestUtils.cs (1)
30["sha256"] = new Regex(@"^[a-f0-9]{64}$"),
ImageBuilder.cs (1)
29internal static Regex aspnetPortRegex = new(@"(?<scheme>\w+)://(?<domain>([*+]|).+):(?<port>\d+)");
ReferenceParser.cs (13)
98public static readonly Regex DomainRegexp = new(domain); 104public static readonly Regex AnchoredDomainRegexp = new(anchored(domain)); 114public static readonly Regex TagRegexp = new(tag); 126public static readonly Regex anchoredTagRegexp = new(anchoredTag); 172public static readonly Regex DigestRegexp = new(digestPat); 182public static readonly Regex AnchoredDigestRegexp = new(anchored( 203public static readonly Regex NameRegexp = new(namePat); 218public static readonly Regex anchoredNameRegexp = new(anchoredName); 236public static readonly Regex ReferenceRegexp = new(referencePat); 250public static readonly Regex IdentifierRegexp = new(identifier); 264public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 276private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 290private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier);
Microsoft.NET.Sdk.Publish.Tasks (2)
MsDeploy\VsMSDeployObject.cs (1)
189RegularExpressions.Regex match = new(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase);
WebConfigTelemetry.cs (1)
14() => new Regex
Microsoft.NET.Sdk.StaticWebAssets.Tasks (5)
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
ScopedCss\RewriteCss.cs (1)
27private static readonly Regex s_deepCombinatorRegex = new($@"^{DeepCombinatorText}\s*", RegexOptions.None, s_regexTimeout);
UpdateExternallyDefinedStaticWebAssets.cs (1)
198var regex = new Regex(pattern, regexOptions);
Microsoft.TemplateEngine.Cli (1)
TemplateInvoker.cs (1)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (1)
Mount\Archive\ZipFileDirectory.cs (1)
25Regex r = new Regex($"^{rx}$");
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (2)
ValueForms\KebabCaseValueFormFactory.cs (1)
21Regex pattern = new(@"(?:\p{Lu}\p{M}*)?(?:\p{Ll}\p{M}*)+|(?:\p{Lu}\p{M}*)+(?!\p{Ll})|\p{N}+|[^\p{C}\p{P}\p{Z}]+|[\u2700-\u27BF]");
ValueForms\ReplacementValueFormFactory.cs (1)
39return new ReplacementValueFormSettings(new Regex(jObject.ToString("pattern")), jObject.ToString("replacement"));
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("\\?", ".") + "$");
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\TimeSpanParser.cs (1)
11static readonly Regex Pattern = new(@"(?<value>^\d+(?:\.\d+)?)\s*(?<suffix>ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase);
Microsoft.VisualStudio.TestPlatform.Common (2)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpressionWrapper.cs (1)
82FastFilter.PropertyValueRegex = new Regex(regexString, RegexOptions.Compiled);
Utilities\RunSettingsProviderExtensions.cs (1)
100Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
44private static readonly Regex InvalidXmlCharsRegex = new(
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
DataCollector\Common\FileHelper.cs (1)
15private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.Web.XmlTransform (4)
XmlElementContext.cs (1)
300nameAndArgumentsRegex = new Regex(@"\A\s*(?<name>\w+)(\s*\((?<arguments>.*)\))?\s*\Z", RegexOptions.Compiled|RegexOptions.Singleline);
XmlTransforms.cs (3)
312s_dirRegex = new RegularExpressions.Regex(@"\G\{%(\s*(?<attrname>\w+(?=\W))(\s*(?<equal>=)\s*'(?<attrval>[^']*)'|\s*(?<equal>=)\s*(?<attrval>[^\s%>]*)|(?<equal>)(?<attrval>\s*?)))*\s*?%\}"); 324s_parentAttribRegex = new RegularExpressions.Regex(@"\G\$\((?<tagname>[\w:\.]+)\)"); 336s_tokenFormatRegex = new RegularExpressions.Regex(@"\G\#\((?<tagname>[\w:\.]+)\)");
NuGet.CommandLine.XPlat (1)
Commands\Package\Stage\StagePushCommandRunner.cs (1)
25private static readonly Regex GroupIdRegex = new("^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$");
NuGet.Common (1)
PathUtil\PathResolver.cs (1)
99return new Regex('^' + pattern + '$', RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant);
NuGet.Configuration (1)
Proxy\WebProxy.cs (1)
84.Select(x => new Regex(x, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
NuGet.Packaging (4)
Licenses\LicenseExpressionTokenizer.cs (1)
13private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
Licenses\NuGetLicense.cs (1)
89var regex = new Regex("^[a-zA-Z0-9\\.\\-]+$", RegexOptions.CultureInvariant);
PackageCreation\Utility\PackageIdValidator.cs (1)
28private static readonly Regex IdRegex = new Regex(pattern: @"^\w+([.-]\w+)*\z",
Signing\Content\KeyPairFileReader.cs (1)
14private static readonly Regex NamePattern = new Regex("^[a-zA-Z0-9\\.\\-/]+$", RegexOptions.CultureInvariant);
QuarantineTools.Tests (6)
ActiveIssueTests.cs (2)
184Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[ActiveIssue", RegexOptions.Multiline), norm); 186Assert.Matches(new Regex(@"\[Fact\]\n\s+\[ActiveIssue\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
QuarantineScriptTests.cs (4)
196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline); 217Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[QuarantinedTest", RegexOptions.Multiline), norm); 219Assert.Matches(new Regex(@"\[Fact\]\n\s+\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
sdk-tasks (2)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
ZipFileCreateFromDirectory.cs (1)
70regexes[i] = new Regex(ExcludePatterns[i].ItemSpec, RegexOptions.IgnoreCase);
SelectTests (1)
ChangedFileFilter.cs (1)
133return new Regex("^" + sb + "$", RegexOptions.CultureInvariant);
SuperFileCheck (2)
Program.cs (2)
79var regex = new System.Text.RegularExpressions.Regex(pattern); 90var invalidRegex = new System.Text.RegularExpressions.Regex(invalidFullLinePattern);
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (2)
121? new Regex(Pattern) 122: new Regex(Pattern, default(RegexOptions), TimeSpan.FromMilliseconds(MatchTimeoutInMilliseconds));
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
18_regex = new Regex(regex, RegexOptions.Compiled);
System.Data.Common (1)
System\Data\Common\DBCommandBuilder.cs (1)
47_parameterNameParser = new Regex(_dbCommandBuilder.ParameterNamePattern!, RegexOptions.ExplicitCapture | RegexOptions.Singleline);
System.DirectoryServices.AccountManagement (1)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (1)
337regex = new Regex(SAMUtils.PAPIQueryToRegexString(wildcardFilter), RegexOptions.Singleline);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
341regexBypassList[i] = new Regex((string)bypassList[i]!, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
System.Private.Xml (1)
System\Xml\Schema\FacetChecker.cs (1)
367_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString())));
System.Text.RegularExpressions (8)
System\Text\RegularExpressions\Regex.Cache.cs (2)
145regex = new Regex(pattern, culture); 164regex = new Regex(pattern, options, matchTimeout, culture);
System\Text\RegularExpressions\Regex.Match.cs (4)
199/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval 329/// <see cref="Regex"/> object with the <see cref="Regex(string, RegexOptions)"/> constructor and calling 367/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and calling the instance 415/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval
System\Text\RegularExpressions\Regex.Timeout.cs (2)
36/// The <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and a number of static matching 87/// object by calling the <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor; and you can
vstest.console (1)
Internal\MSBuildLogger.cs (1)
511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
vstest.console.arm64 (1)
parent\vstest.console\Internal\MSBuildLogger.cs (1)
511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
1721 references to Regex
AnalyzeCiFailure (71)
AnalysisPublisher.cs (7)
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"; 614if (!validId || !Regex.IsMatch(result, pattern)) 637private static partial Regex GitHubRepositoryNameRegex(); 640private static partial Regex PullRequestNumberRegex();
AnalysisPublisher.Overflow.cs (2)
103if (issueUrl is not null && System.Text.RegularExpressions.Regex.IsMatch( 104issueUrl, "^" + System.Text.RegularExpressions.Regex.Escape($"https://github.com/{_repository}/issues/") + @"[1-9][0-9]*\z"))
AnalysisValidator.cs (3)
349private static partial Regex CauseIdSlugRegex(); 352private static partial Regex PositivePullRequestNumberRegex(); 355private static partial Regex GitHubRepositoryNameRegex();
CauseHistoryStore.cs (2)
36.Any(line => Regex.IsMatch(line, @"^[0-9a-fA-F]{40,64}\trefs/heads/" + Regex.Escape(BranchName) + @"\z")))
CauseIssueRenderer.cs (5)
371=> Regex.Matches(body, "^" + Regex.Escape(marker) + @"(?=\r?$)", RegexOptions.Multiline | RegexOptions.CultureInvariant); 374private static partial Regex OccurrenceSummaryCountRegex(); 377private static partial Regex OccurrenceSummaryRegex(); 380private static partial Regex OccurrenceRowRegex();
DiagnosticTextSanitizer.cs (36)
30private static readonly (Regex Pattern, string Replacement)[] s_diagnosticRedactionRules = 32private static readonly (Regex Pattern, string Replacement)[] s_runMetadataRedactionRules = 41private static string RedactAndNormalize(string text, int limit, bool multiline, (Regex Pattern, string Replacement)[] rules) 113private static (Regex, string)[] CreateSecretRedactionRules(bool preserveConnectionStringDescriptions) 115var rules = new List<(Regex, string)>(); 116void Add(Regex pattern, string replacement = "${prefix}[REDACTED]${suffix}") 118void AddQuotedValueRules(Regex doubleQuoted, Regex singleQuoted) 154private static partial Regex SingleLineWhitespaceRegex(); 157private static partial Regex TerminalEscapeRegex(); 160private static partial Regex PrivateKeyRegex(); 163private static partial Regex AuthorizationHeaderRegex(); 166private static partial Regex SecretHeaderRegex(); 169private static partial Regex UrlCredentialsRegex(); 172private static partial Regex UrlUsernameRegex(); 175private static partial Regex JsonWebTokenRegex(); 178private static partial Regex AccessTokenRegex(); 181private static partial Regex SecretQueryParameterRegex(); 184private static partial Regex DoubleQuotedJsonSettingRegex(); 187private static partial Regex SingleQuotedJsonSettingRegex(); 190private static partial Regex DoubleQuotedCommandLineOptionRegex(); 193private static partial Regex SingleQuotedCommandLineOptionRegex(); 196private static partial Regex UnquotedCommandLineOptionRegex(); 199private static partial Regex DoubleQuotedRootConnectionStringRegex(); 202private static partial Regex SingleQuotedRootConnectionStringRegex(); 205private static partial Regex DoubleQuotedNamedConnectionStringRegex(); 208private static partial Regex SingleQuotedNamedConnectionStringRegex(); 211private static partial Regex UnquotedRootConnectionStringRegex(); 214private static partial Regex UnquotedNamedConnectionStringRegex(); 217private static partial Regex UnquotedConnectionStringRegex(); 220private static partial Regex DoubleQuotedNonConnectionSettingRegex(); 223private static partial Regex DoubleQuotedSecretSettingRegex(); 226private static partial Regex SingleQuotedNonConnectionSettingRegex(); 229private static partial Regex SingleQuotedSecretSettingRegex(); 232private static partial Regex UnquotedNonConnectionSettingRegex(); 235private static partial Regex UnquotedSecretSettingRegex();
MarkdownFormatting.cs (1)
24private static partial Regex BacktickRunRegex();
MarkdownTemplate.cs (1)
46private static partial Regex NamedPlaceholderRegex();
OverflowIssueRenderer.cs (4)
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);
PriorCauseCatalogue.cs (1)
68private static partial Regex CauseIdSlugRegex();
WorkflowRunEvidenceCollector.cs (4)
807private static partial Regex GitHubRepositoryNameRegex(); 813private static partial Regex LogFailureRegex(); 818private static partial Regex PassingTestRegex(); 822private static partial Regex ExplicitFailureRegex();
Workflows\AspireCiWorkflowConventions.cs (5)
81private static partial Regex RequiredTestJobNameRegex(); 84private static partial Regex AggregationStepNameRegex(); 87private static partial Regex ExtensionTestJobNameRegex(); 90private static partial Regex TestArtifactJobNameRegex(); 93private static partial Regex ExtensionArtifactJobNameRegex();
AnalyzeCiFailure.TestHost (1)
tests\AnalyzeCiFailure.Tests\TestServices\GitHubFixtureHandler.cs (1)
204var digits = Regex.Match(url, createdKind == "issue" ? @"/issues/([0-9]+)$" : @"#issuecomment-([0-9]+)$").Groups[1].Value;
AnalyzeCiFailure.Tests (4)
AnalyzeCiFailureMigrationTests.cs (1)
609private static partial Regex JsonExampleRegex();
AnalyzeCiFailureProgressTests.cs (2)
29text = Regex.Replace(text, @"(?m)^\[[^\]]+\] ", "[time] "); 30text = Regex.Replace(text, @"duration_ms=\d+", "duration_ms=<elapsed>");
TestServices\GitHubFixtureHandler.cs (1)
204var digits = Regex.Match(url, createdKind == "issue" ? @"/issues/([0-9]+)$" : @"#issuecomment-([0-9]+)$").Groups[1].Value;
aspire (66)
Acquisition\InstallationDiscovery.cs (1)
406private static partial Regex PrChannelVersionRegex();
Agents\Hooks\AgentTelemetryCatalog.cs (6)
49private static HashSet<string> ParseIdentifiers(string script, Regex declaration, string variableName) 60private static HashSet<string> ParseValues(string script, Regex declaration, string variableName) 96private static partial Regex SkillsDeclaration(); 99private static partial Regex McpToolsDeclaration(); 102private static partial Regex ReferenceFilesDeclaration(); 105private static partial Regex Identifier();
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
293var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, maxRegexTimeout); 314var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, maxRegexTimeout);
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
828private static partial Regex OpenSslVersionRegex { get; } 904private static partial Regex OpenSslHashFilenameRegex { get; } 911private static partial Regex OpenSslCertificateExtensionRegex { get; }
Certificates\CertificateHelpers.cs (1)
148internal static partial Regex OpenSslVersionRegex();
Commands\NewCommand.cs (2)
1039internal static partial Regex GetProjectNameRegex(); 1048var regex = GetProjectNameRegex();
Commands\PipelineCommandBase.cs (1)
772return System.Text.RegularExpressions.Regex.Replace(text, @"\[/?[^\]]*\]", "");
Documentation\ApiDocs\ApiDocsIndexService.cs (1)
1181private static partial Regex TokenSplitRegex();
Documentation\ApiDocs\ApiDocsSourceConfiguration.cs (1)
231private static partial Regex LocalMarkdownLinkRegex();
Documentation\ApiDocs\ApiMemberMarkdownParser.cs (1)
149private static partial Regex MemberOverviewRegex();
Documentation\Docs\DocsIndexService.cs (18)
1011private static string ReplaceIfMatches(string input, Regex regex, string replacement) 1052private static partial Regex TokenSplitRegex(); 1056private static partial Regex CodeBlockRegex(); 1060private static partial Regex IdentifierRegex(); 1063private static partial Regex MarkdownFenceBlockRegex(); 1066private static partial Regex InlineHeadingRegex(); 1069private static partial Regex SectionTitledBookmarkRegex(); 1072private static partial Regex InlineOrderedListRegex(); 1075private static partial Regex InlineUnorderedListRegex(); 1078private static partial Regex InlineTableStartRegex(); 1081private static partial Regex InlineTableRowBoundaryRegex(); 1084private static partial Regex InlineTableEndRegex(); 1087private static partial Regex TrailingWhitespaceBeforeNewlineRegex(); 1090private static partial Regex ExcessBlankLinesRegex(); 1093private static partial Regex LeadingWhitespaceRegex(); 1096private static partial Regex BlankLineAfterHeadingRegex(); 1099private static partial Regex BlankLineAfterTableRegex(); 1102private static partial Regex BlankLineAfterListRegex();
Documentation\Docs\DocsSourceConfiguration.cs (1)
117private static partial Regex MarkdownLinkRegex();
Documentation\LexicalScoring.cs (1)
36public static string[] Tokenize(string text, Regex tokenSplitRegex, int minTokenLength)
Projects\DotNetAppHostProject.cs (1)
1245private static partial Regex WalkUpFunctionCallStartRegex();
Projects\FallbackProjectParser.cs (2)
23internal static partial Regex SdkDirectiveRegex(); 28private static partial Regex PackageDirectiveRegex();
Projects\LegacyTypeScriptAppHost.cs (1)
185private static partial Regex LegacyAppHostFileNameRegex();
Projects\ProjectUpdater.cs (2)
1314internal static Regex SdkDirectiveRegex() => FallbackProjectParser.SdkDirectiveRegex(); 1321internal static partial Regex LegacyAppHostPackageDirectiveRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ConsoleLogs\UrlParser.cs (2)
14private static readonly Regex s_urlRegEx = GenerateUrlRegEx(); 73public static partial Regex GenerateUrlRegEx();
src\Shared\ContainerRuntimeProbe.cs (1)
479var match = Regex.Match(output, @"[Vv]ersion\s*:?\s*(\d+\.\d+(?:\.\d+)?)", RegexOptions.IgnoreCase);
src\Shared\DateFormatStringsHelpers.cs (6)
24private static partial Regex MatchSecondsInTimeFormatPattern(); 28private static partial Regex MatchHourIn24HourTimeFormatPattern(); 32private static partial Regex MatchHourIn12HourTimeFormatPattern(); 36private static partial Regex MatchAmPmDesignator(); 40private static partial Regex MatchFullMonthName(); 51private static partial Regex MatchDayOfWeek();
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
1917private static partial Regex GitHubTokenRegex(); 1920private static partial Regex MicrosoftAccountRegex();
Templating\ConditionalBlockProcessor.cs (1)
46private static partial Regex LeftoverMarkerPattern();
Utils\ConsoleActivityLogger.cs (1)
841return Regex.Replace(
Utils\EnvironmentChecker\GoAppHostToolingCheck.cs (1)
315private static partial Regex GoVersionRegex();
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (4)
244private static partial Regex Wsl1KernelRelease(); 255private static partial Regex Wsl2KernelRelease(); 259private static partial Regex KernelRelease(); 265private static partial Regex NumericKernelRelease();
Utils\Markdown\MarkdownLinkConverter.cs (1)
29private static partial Regex LinkRegex();
Utils\Markdown\MarkdownToSpectreConverter.cs (1)
358private static partial Regex HtmlTagRegex();
Aspire.Acquisition.Tests (6)
Scripts\HomebrewCompletionTests.cs (1)
24var match = Regex.Match(template,
Scripts\LocalHiveScriptFunctionTests.cs (1)
31var userEnvironmentWrite = new System.Text.RegularExpressions.Regex(
Scripts\PRScriptInstallerModeTests.cs (1)
482var m = System.Text.RegularExpressions.Regex.Match(line, @"^\s*-?\s*RelativeFilePath:\s*(\S+)\s*$");
Scripts\PRScriptPowerShellTests.cs (1)
57var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Scripts\PRScriptToolModeTests.cs (1)
723var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Scripts\ReleaseScriptPowerShellTests.cs (1)
328var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Aspire.Azure.AI.Extensions.OpenAI (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.AI.Projects (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Data.Tables (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Messaging.EventHubs (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Messaging.ServiceBus (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Messaging.WebPubSub (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Search.Documents (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Security.KeyVault (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Storage.Blobs (2)
AzureBlobStorageContainerSettings.cs (1)
16private static partial Regex ContainerNameRegex();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Storage.Files.DataLake (2)
AzureDataLakeFileSystemSettings.cs (1)
16private static partial Regex FileSystemNameRegex();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Azure.Storage.Queues (2)
AzureStorageQueueSettings.cs (1)
16private static partial Regex QueueNameRegex();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Cli.EndToEnd.Tests (22)
CentralPackageManagementTests.cs (2)
206var sdkMatch = System.Text.RegularExpressions.Regex.Match( 385var packageDirectiveRegex = new Regex(
DoctorCommandTests.cs (1)
172var renderedRuntimeMessages = Regex.Matches(text, @"(?:(?:Docker|Podman)(?: v\d+\.\d+\.\d+)?: (?:running|installed but not running)|Docker is running in Windows container mode)[^\r\n]*")
EmulatedLocalReleaseBuildTests.cs (2)
627var match = Regex.Match(content, "Include=\"(?<id>Aspire\\.[^\"]*Redis[^\"]*)\"\\s+Version=\"(?<version>[^\"]+)\""); 630match = Regex.Match(content, "Version=\"(?<version>[^\"]+)\"\\s+Include=\"(?<id>Aspire\\.[^\"]*Redis[^\"]*)\"");
Helpers\CliE2ETestHelpers.cs (7)
34private static readonly Regex s_commitShaPattern = new("^[0-9a-fA-F]{40}$", RegexOptions.Compiled); 55var match = Regex.Match(content, @"(?m)^[ \t]*#:[ \t]*(?:package[ \t]+Aspire\.Hosting\.AppHost|sdk[ \t]+Aspire\.AppHost\.Sdk)@(?<version>[^ \t\r\n]+)[ \t]*\r?$"); 788var branchMatch = Regex.Match(version, @"^(?<major>\d+)\.(?<minor>\d+)\."); 852var match = Regex.Match(finalUrl, @"aspire-cli-[^/]+?-(?<version>\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?)\.tar\.gz", RegexOptions.IgnoreCase); 1076.Where(static fileName => fileName is not null && Regex.IsMatch(fileName, @"^Aspire\.Hosting\.\d+\.\d+\.\d+.*\.nupkg$", RegexOptions.IgnoreCase)) 1134var stablePackageRegex = new Regex(@"^Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase); 1170var stablePackageRegex = new Regex(@"^(?:\./)?hives/local/packages/Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase);
Helpers\ConfigSourceTestContext.cs (2)
205Regex.Replace(consentOutput, @"\s+", " ")); 350Assert.Contains("No configuration source to update.", Regex.Replace(output, @"\s+", " "));
Helpers\LaunchSettingsPortHelpers.cs (1)
78private static partial Regex PortRegex();
McpDocsE2ETests.cs (1)
305private static partial Regex SlugRegex();
RadiusDeployTests.cs (1)
630var emittedTypes = Regex.Matches(appBicep, @"^resource\s+\S+\s+'(?<type>[^']+)'", RegexOptions.Multiline)
tests\Shared\CliInstallStrategy.cs (1)
140if (!Regex.IsMatch(sha, @"^[0-9a-fA-F]{7,40}$") && sha != "main")
tests\Shared\CliPackageDiscovery.cs (3)
107private static partial Regex VersionPattern(); 110private static partial Regex PullRequestVersionPattern(); 113private static partial Regex RidSpecificPackagePattern();
TypeScriptCodegenValidationTests.cs (1)
224if (Regex.IsMatch(initialAspireTs, @"(?m)^\s*(?![*/])\S.*\baddRedis\s*\("))
Aspire.Cli.Tests (29)
Agents\AgentTelemetryHookTests.cs (6)
266var body = Regex.Match(script, $@"\${name} = @\((.*?)\)", RegexOptions.Singleline).Groups[1].Value; 267return Regex.Matches(body, "'([^']+)'").Select(match => match.Groups[1].Value).Order().ToArray(); 354Regex.IsMatch(toolName, $"^(?:{CopilotAgentClient.TelemetryHookMatcher})$", RegexOptions.ECMAScript); 357Regex.IsMatch(toolName, matcher, RegexOptions.ECMAScript); 369var pattern = Regex.Escape(glob) 373return Regex.IsMatch(path, $"^{pattern}$");
Commands\GoAppHostToolingCheckTests.cs (2)
535var directive = Regex.Match(File.ReadAllText(sourcePath), @"^\s*go (\d+\.\d+)\s*$", RegexOptions.Multiline); 546var defaultVersion = Regex.Match(detector, """DefaultGoVersion = "(\d+\.\d+)";""");
Commands\NewCommandLocalTemplateTests.cs (3)
837.ScrubLinesWithReplace(line => Regex.Replace(line, "aspire-apphost-[a-f0-9]{16}", "aspire-apphost-source")) 872.ScrubLinesWithReplace(line => Regex.Replace(line, "aspire-apphost-[a-f0-9]{16}", "aspire-apphost-source")) 1024.ScrubLinesWithReplace(line => Regex.Replace(line, "aspire-apphost-[a-f0-9]{16}", "aspire-apphost-source"))
Commands\PipelineCommandListStepsTests.cs (1)
16private static partial Regex AnsiEscapeRegex();
Interaction\ConsoleInteractionServiceTests.cs (1)
263rendered = Regex.Replace(rendered, @"(?<=\x1b]8;id=)\d+", "link-id");
Mcp\E2E\McpDocsE2ETests.cs (1)
310private static partial Regex SlugRegex();
Mcp\ListConsoleLogsToolTests.cs (1)
532var match = Regex.Match(text, @"```plaintext\s*(.*?)\s*```", RegexOptions.Singleline);
Npm\AspireJsLauncherTests.cs (2)
187var supportedRidsMatch = Regex.Match(scriptContent, @"\$supportedRids\s*=\s*@\((?<rids>[^)]*)\)", RegexOptions.Singleline); 190return Regex.Matches(supportedRidsMatch.Groups["rids"].Value, @"'(?<rid>[^']+)'")
Projects\ProjectUpdaterTests.cs (2)
3725var regex = ProjectUpdater.SdkDirectiveRegex(); 3751var regex = ProjectUpdater.LegacyAppHostPackageDirectiveRegex();
Templating\TemplateNuGetConfigServiceTests.cs (2)
115.ScrubLinesWithReplace(line => Regex.Replace(line, "aspire-apphost-[a-f0-9]{16}", "aspire-apphost-source")); 241.ScrubLinesWithReplace(line => Regex.Replace(line, "aspire-apphost-[a-f0-9]{16}", "aspire-apphost-source"));
Utils\MarkdownToSpectreConverterTests.cs (1)
740private static partial Regex AnsiEscapeRegex();
Utils\TemporaryWorkspaceTests.cs (4)
93Assert.Contains(recordingOutput.Messages, message => message.Contains("finished after ", StringComparison.Ordinal) && System.Text.RegularExpressions.Regex.IsMatch(message, @"exit code: -?\d+$")); 134var match = System.Text.RegularExpressions.Regex.Match(message, @"started with PID (\d+) after "); 155Assert.Contains(recordingOutput.Messages, message => message.Contains("finished after ", StringComparison.Ordinal) && System.Text.RegularExpressions.Regex.IsMatch(message, @"exit code: -?\d+$")); 192Assert.Contains(recordingOutput.Messages, message => message.Contains("finished after ", StringComparison.Ordinal) && System.Text.RegularExpressions.Regex.IsMatch(message, @"exit code: -?\d+$"));
Utils\TerminalLinkAssert.cs (3)
13output = Regex.Replace(output, @"\x1b\[[0-9;]*m", string.Empty); 18var escapedLink = Regex.Escape(link); 20var matches = Regex.Matches(output, segmentPattern, RegexOptions.Singleline);
Aspire.Confluent.Kafka (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Confluent.Kafka.Tests (1)
KafkaContainerFixture.cs (1)
86private static partial Regex KafkaReadyRegex();
Aspire.Dashboard (22)
Components\Layout\MobileNavMenu.razor.cs (2)
204private static Regex GetNonIndexPageRegex(params string[] pageRelativeBasePaths) 207.Select(Regex.Escape)
Components\Layout\MobileNavMenuEntry.cs (1)
14Regex? LinkMatchRegex = null,
Components\Legacy\Layout\LegacyMobileNavMenu.razor.cs (3)
233private static Regex GetNonIndexPageRegex(string pageRelativeBasePath) 235pageRelativeBasePath = Regex.Escape(pageRelativeBasePath); 241private static readonly Regex s_resourcesPageRegex = new($"^{LegacyNavUrls.BasePath}(/|/resources/?)?(\\?.*)?$", LinkMatchRegexOptions);
Components\Legacy\Layout\MobileNavMenuEntry.cs (1)
14Regex? LinkMatchRegex = null);
Model\ConnectionStringParser.cs (2)
62private static partial Regex HostPortRegex(); 69private static partial Regex JdbcUrlRegex();
Model\ResourceOutgoingPeerResolver.cs (1)
24private static partial Regex HostRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ConsoleLogs\UrlParser.cs (2)
14private static readonly Regex s_urlRegEx = GenerateUrlRegEx(); 73public static partial Regex GenerateUrlRegEx();
src\Shared\DateFormatStringsHelpers.cs (6)
24private static partial Regex MatchSecondsInTimeFormatPattern(); 28private static partial Regex MatchHourIn24HourTimeFormatPattern(); 32private static partial Regex MatchHourIn12HourTimeFormatPattern(); 36private static partial Regex MatchAmPmDesignator(); 40private static partial Regex MatchFullMonthName(); 51private static partial Regex MatchDayOfWeek();
src\Shared\InteractionHelpers.cs (1)
22private static partial Regex NonAlphanumericRegex();
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
1917private static partial Regex GitHubTokenRegex(); 1920private static partial Regex MicrosoftAccountRegex();
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 (6)
ConsoleLogsTests\UrlParserTests.cs (2)
101var regex = UrlParser.GenerateUrlRegEx(); 114var regex = UrlParser.GenerateUrlRegEx();
Markdown\MarkdownProcessorTests.cs (3)
43var count = Regex.Matches(html, Regex.Escape("code-block")).Count; 171var title = Regex.Match(html, "<div class=\"code-title\">(.*?)</div>").Groups[1].Value;
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.Deployment.EndToEnd.Tests (4)
tests\Shared\CliInstallStrategy.cs (1)
140if (!Regex.IsMatch(sha, @"^[0-9a-fA-F]{7,40}$") && sha != "main")
tests\Shared\CliPackageDiscovery.cs (3)
107private static partial Regex VersionPattern(); 110private static partial Regex PullRequestVersionPattern(); 113private static partial Regex RidSpecificPackagePattern();
Aspire.EndToEnd.Tests (4)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled); 569private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting (10)
Dashboard\DashboardService.cs (1)
63private static partial Regex ApplicationNameRegex();
Dcp\ContainerNetworkEndpointProvisioner.cs (1)
543private static partial Regex ApplicationNameRegex();
Dcp\DcpDependencyCheck.cs (1)
20private static partial Regex VersionRegex();
Dcp\Model\ModelCommon.cs (1)
246bool isValid = Regex.IsMatch(candidate, @"^[[a-zA-Z_~][a-zA-Z0-9\-._~]*$");
Pipelines\Internal\FileDeploymentStateManager.cs (1)
38private static partial Regex ValidEnvironmentNameRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ContainerRuntimeProbe.cs (1)
479var match = Regex.Match(output, @"[Vv]ersion\s*:?\s*(\d+\.\d+(?:\.\d+)?)", RegexOptions.IgnoreCase);
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
src\Shared\InteractionHelpers.cs (1)
22private static partial Regex NonAlphanumericRegex();
Utils\ContainerReferenceParser.cs (1)
40private static partial Regex ImageNameRegex();
Aspire.Hosting.Azure (1)
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
60private static partial Regex ResourceGroupValidCharacters();
Aspire.Hosting.Azure.EntraId (3)
Provisioning\EntraIdSymbolNames.cs (2)
124private static partial Regex FixedParameterPattern(); 127private static partial Regex NonAlphanumeric();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.Azure.EntraId.Tests (1)
EntraIdApiProvisioningTests.cs (1)
1378var symbols = System.Text.RegularExpressions.Regex.Matches(bicep, @"^(?:param|resource) (\S+)", System.Text.RegularExpressions.RegexOptions.Multiline)
Aspire.Hosting.Azure.KeyVault (1)
AzureKeyVaultResourceExtensions.cs (1)
401private static partial Regex AzureKeyVaultSecretNameRegex();
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
982private static partial Regex AzureResourceNamePattern();
Aspire.Hosting.Azure.Tests (4)
AzureContainerAppsTests.cs (2)
474var aliases = Regex.Matches(bicep, @"name: '(ConnectionStrings__[^']+)'") 2452var match = System.Text.RegularExpressions.Regex.Match(
AzureResourcePreparerTests.cs (1)
794var roleAssignmentCount = System.Text.RegularExpressions.Regex.Matches(manifest.BicepText, "Microsoft.Authorization/roleAssignments@").Count;
AzureSqlPrincipalReconciliationTests.cs (1)
225var match = Regex.Match(
Aspire.Hosting.CodeGeneration.Go (4)
GoDocComment.cs (4)
687private static partial Regex AtsReferenceRegex(); 690private static partial Regex GenericArityRegex(); 693private static partial Regex CodeSpanRegex(); 696private static partial Regex WhitespaceRegex();
Aspire.Hosting.CodeGeneration.Go.Tests (18)
AtsGoCodeGeneratorTests.cs (3)
2538$@"if {Regex.Escape(nilGuard)} \{{\s+reqArgs\[""{parameterName}""\] = serializeValue\({parameterName}\)\s+\}}", 2690var optionTypes = Regex.Matches(aspireGo, @"(?m)^type (FooBarBaz\d+) string$") 2749Assert.Matches($@"{name}\s+{Regex.Escape(expectedType)}\b", aspireGo);
AtsGoDerivedBuilderTests.cs (8)
106Assert.Single(Regex.Matches(generated, @"^var AnyPoolResource = struct \{", RegexOptions.Multiline)); 119Assert.Single(Regex.Matches(generated, @"^\tAnyPoolResource AnyPool = ""Resource""", RegexOptions.Multiline)); 263var errors = Regex.Matches(output, @"negative\.go:\d+:\d+: [^\r\n]+") 449Regex.Matches(generated, @"^type (Any\w+) interface ", RegexOptions.Multiline) 456var declaration = Regex.Match(generated, $@"^type {interfaceName} interface \{{\r?\n(?<body>.*?)^\}}", RegexOptions.Multiline | RegexOptions.Singleline); 464.Where(member => Regex.IsMatch(member, @"^is\w+\(\)$")) 469Regex.Matches(generated, @"func\s+\(\*(\w+)\)\s+(is\w+)\(\)\s+\{\}") 475Regex.Matches(generated, $@"^func \(s \*{implName}\) ({methodPrefix}[^\r\n]*) \{{\r?$", RegexOptions.Multiline)
GoApiExportTests.cs (2)
477var normalizedGeneratedCode = Regex.Replace(generatedCode, @"\s+", " "); 481Regex.Replace(variable.Declaration, @"\s+", " "),
GoDocCommentTests.cs (5)
155if (Regex.IsMatch(sdk, "\r(?!\n)")) 176if (!Regex.IsMatch(lines[first].Trim(), $"^// {Regex.Escape(name)}(?:[ ,.:]|$)")) 210var commentedConstants = lines.Where((line, i) => i > 0 && IsComment(lines[i - 1]) && Regex.IsMatch(line, "^\t\\w+ \\w+ = \"[^\"]*\"$")).Count(); 371var match = Regex.Match(line, @"^(?:type |var |const |func (?:\([^)]*\) )?|\t)(?<name>[A-Z]\w*)\b");
Aspire.Hosting.CodeGeneration.Java.Tests (6)
AtsJavaCodeGeneratorTests.cs (5)
127Assert.Empty(Regex.Matches(generated, @"\bDouble\b(?!\.)")); 464.Where(kvp => Regex.IsMatch(kvp.Value, @"^import\s+[\w.]+\.\*;", RegexOptions.Multiline)) 485foreach (Match import in Regex.Matches(content, @"^import\s+(?:static\s+)?([\w.]+)\.(\w+);", RegexOptions.Multiline)) 490if (!Regex.IsMatch(body, $@"\b{Regex.Escape(simpleName)}\b"))
JavaLanguageSupportTests.cs (1)
41var match = Regex.Match(
Aspire.Hosting.CodeGeneration.TypeScript (1)
TypeScriptApiProjector.cs (1)
1124private static partial Regex DeclaredTypeNameRegex();
Aspire.Hosting.CodeGeneration.TypeScript.Tests (17)
AtsTypeScriptCodeGeneratorTests.cs (17)
1362var declaration = Regex.Match(code, $@"^export interface {name}(?: extends [^\n]+)? \{{.*?^\}}", 1371var implementation = Regex.Match(code, $@"^class {resourceType.Name}Impl\b.*?^\}}", 1374var invocation = Regex.Match(implementation.Value, @"^ private async _withContainerImageInternal\(.*?^ \}", 1481var volumeInterface = Regex.Match(generatedCode, @"^export interface KubernetesPersistentVolumeResource \{.*?^\}", 1483var callback = Regex.Match(volumeInterface.Value, @"^\s+withConfiguration\(.*$", RegexOptions.Multiline); 1488var match = Regex.Match(generatedCode, $@"^export interface {name} \{{.*?^\}}", 1782private static readonly Regex s_promiseDeclarationPattern = 1787private static readonly Regex s_promiseReferencePattern = 1790private static readonly Regex s_apiDeclarationPattern = 1793private static readonly Regex s_apiTypeReferencePattern = 1801Regex.Replace(Regex.Replace(typeScript, @"/\*.*?\*/", string.Empty, RegexOptions.Singleline), @"//[^\n]*", string.Empty); 1807Regex.Replace( 1906private static readonly Regex s_implementationConstructorPattern = 1914private static readonly Regex s_rpcHandleConstructionPattern = 2656var match = Regex.Match(code, $@"^export interface {Regex.Escape(name)} \{{.*?^\}}", RegexOptions.Multiline | RegexOptions.Singleline);
Aspire.Hosting.DevTunnels (11)
DevTunnelOutputParser.cs (7)
195private static partial Regex WhitespaceRegex(); 198private static partial Regex MessageBoundaryRegex(); 201private static partial Regex WordsRegex(); 204private static partial Regex AnsiRegex(); 207private static partial Regex PortRegex(); 210private static partial Regex UrlRegex(); 213private static partial Regex ReadyRegex();
DevTunnelResourceBuilderExtensions.cs (2)
1016private static partial Regex TunnelIdRegex(); 1019private static partial Regex LabelRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.Docker.Tests (2)
DockerComposePublisherTests.cs (2)
309var aliases = Regex.Matches(compose, @"(?m)^\s+(ConnectionStrings__[^:]+):") 1176.ScrubLinesWithReplace(line => Regex.Replace(line, @"aspire-deploy-\d{14}", "aspire-deploy-TIMESTAMP"));
Aspire.Hosting.Dotnet (2)
DotnetProjectBuildCoordinator.cs (1)
378private static partial Regex MsBuildErrorRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
Aspire.Hosting.Foundry (5)
FoundryLocalService.cs (4)
22private static readonly Regex s_urlRegex = new(@"https?://\S+", RegexOptions.Compiled); 23private static readonly Regex s_progressRegex = new(@"(?<progress>\d+(?:\.\d+)?)\s*%", RegexOptions.Compiled); 566if (Regex.IsMatch(helpOutput, @"(?im)^\s*(?:Server:\s*)?server(?:\s|$)")) 571if (Regex.IsMatch(helpOutput, @"(?im)^\s*service(?:\s|$)"))
HostedAgent\HostedAgentConfiguration.cs (1)
196private static partial Regex EnvironmentVariableNameRegex();
Aspire.Hosting.Go (2)
GoVersionDetector.cs (2)
57private static partial Regex ToolchainDirectiveRegex(); 61private static partial Regex GoDirectiveRegex();
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
29private static readonly Regex s_exportIdPattern = new(
Aspire.Hosting.Java (10)
JavaDockerfileGenerator.cs (2)
1312private static partial Regex GradleDistributionRegex(); 1315private static partial Regex MavenDistributionRegex();
JavaHostingExtensions.cs (1)
2118private static partial Regex GradleRootProjectNameRegex();
JavaVersionDetector.cs (7)
463Regex regex, 1085private static partial Regex DirectToolchainRegex(); 1088private static partial Regex ScopedToolchainRegex(); 1091private static partial Regex ConfiguredJavaPluginExtensionRegex(); 1095private static partial Regex LanguageVersionRegex(); 1099private static partial Regex TargetCompatibilityRegex(); 1102private static partial Regex SourceCompatibilityRegex();
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
2751private static partial Regex PnpmVersionRegex();
Aspire.Hosting.Kubernetes (13)
Deployment\HelmDeploymentEngine.cs (2)
111private static partial Regex DnsLabelPattern(); 413private static partial Regex HelmValuesExpressionRegex();
Deployment\HelmVersionValidator.cs (1)
48private static partial Regex HelmVersionRegex();
Extensions\HelmExtensions.cs (6)
179internal static partial Regex HelmFlowControlPattern(); 182private static partial Regex HelmFlowControlExpressionPattern(); 185private static partial Regex QuotedTemplateExpressionPattern(); 188internal static partial Regex EndWithNonStringTypePattern(); 191internal static partial Regex ScalarExpressionPattern(); 194internal static partial Regex ExpressionPattern();
HelmChartOptions.cs (2)
330private static partial Regex DnsLabelPattern(); 333private static partial Regex HelmChartNamePattern();
KubernetesHelmChartExtensions.cs (2)
512private static partial Regex ChartReferencePattern(); 518private static partial Regex HelmSetKeyPattern();
Aspire.Hosting.Kubernetes.Tests (5)
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 (4)
2992var parametersBlockRegex = new System.Text.RegularExpressions.Regex( 2994System.Text.RegularExpressions.Regex.Escape(storageClassName) + @"\s*:"); 2998System.Text.RegularExpressions.Regex.Escape(capacityName) + @"\s*:"), 3002System.Text.RegularExpressions.Regex.Escape(backupTierName) + @"\s*:"),
Aspire.Hosting.Maui (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.MongoDB.Tests (1)
MongoDBTestHelpers.cs (1)
22private static partial Regex TlsConditionalReference();
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
301Match match1 = Regex.Match(fileContents, pattern1); 303Match match2 = Regex.Match(fileContents, pattern2);
Aspire.Hosting.Python (2)
PythonVersionDetector.cs (2)
113private static partial Regex RequiresPythonRegex(); 116private static partial Regex PythonVersionOutputRegex();
Aspire.Hosting.Radius (6)
CloudProviders\CloudProviderValidation.cs (2)
50private static partial Regex AwsAccountIdPattern(); 60private static partial Regex IamRoleArnPattern();
Publishing\BicepPostProcessor.cs (2)
145private static partial Regex RecipePackWithoutProperties(); 425private static partial Regex InvalidIdentifierChars();
RadiusExtensions.cs (1)
104private static partial Regex DnsLabelPattern();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.Radius.Tests (6)
Publishing\ConfigureRadiusInfrastructureTests.cs (2)
682var environmentScopes = Regex.Matches(bicep, @"environment: (\w+)\.id") 687var applicationScopes = Regex.Matches(bicep, @"application: (\w+)\.id")
Publishing\ConnectionStringPropagationTests.cs (1)
114var aliases = Regex.Matches(
Publishing\RadiusDeployParametersTests.cs (3)
357var declarations = Regex.Matches(bicep, @"^@secure\(\)\r?\n\s*param sharedSecret ", RegexOptions.Multiline); 385var declarations = Regex.Matches(bicep, @"^@secure\(\)\r?\n\s*param radiusenv ", RegexOptions.Multiline); 413var declared = Regex.Matches(bicep, @"^\s*param (?<name>\w+) ", RegexOptions.Multiline)
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
1143var match = Regex.Match(valueExpression, @"\{(cond-[^.]+)\.connectionString\}");
Aspire.Hosting.RemoteHost (7)
Ats\CapabilityDispatcher.cs (1)
762var match = Regex.Match(message, @"type '([^']+)'.*(?:to|into) type '([^']+)'");
Ats\PolyglotCapabilityInvocationException.cs (6)
521message = Regex.Replace( 523$@"\b{Regex.Escape(clrMemberName)}\b", 534message = Regex.Replace( 536$@"\b{Regex.Escape(alias.Key)}\b", 592private static partial Regex DoubleWhitespaceRegex(); 595private static partial Regex ControlCharacterRegex();
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.Rust (3)
CargoMetadataReader.cs (1)
215private static partial Regex SensitiveEnvironmentVariableNamePattern();
RustDockerfileGenerator.cs (2)
355private static partial Regex SensitiveCargoConfigAssignmentPattern(); 360private static partial Regex CredentialBearingUrlPattern();
Aspire.Hosting.Rust.Tests (3)
AddRustAppPublishTests.cs (1)
1076var match = Regex.Match(
RustDockerfileSnapshotScrubber.cs (1)
27private static partial Regex TargetCacheIdPattern();
RustReadmeTests.cs (1)
19var links = Regex.Matches(additionalDocumentation, @"https://[^\s)]+")
Aspire.Hosting.Sdk.Tests (5)
AppHostSdkTargetsTests.cs (5)
803Assert.Equal(expectedDiagnostics, Regex.Matches(result.Output, @"\b(?:warning|error) ASPIRE\d+:").Select(match => match.Value.TrimEnd(':'))); 843Assert.Equal(["error ASPIRE013"], Regex.Matches(result.Output, @"\b(?:warning|error) ASPIRE\d+:").Select(match => match.Value.TrimEnd(':'))); 884Assert.Equal(expectedDiagnostics, Regex.Matches(result.Output, @"\b(?:warning|error) ASPIRE\d+:").Select(match => match.Value.TrimEnd(':'))); 2523? $"/D /V:OFF /C {Regex.Replace(aspireCliPath, """[ \t()[\]{}!^`<>&|;,+="~@]""", "^$0")} " 2554var escapedCliPath = Regex.Replace(cliPath, """[ \t()[\]{}!^`<>&|;,+="~@]""", "^$0");
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
25internal static partial Regex GoStatements();
Aspire.Hosting.Tasks (1)
ResolveAspireCliBundle.cs (1)
520var sourceMatch = Regex.Match(sidecar, @"""source""\s*:\s*""(?<source>[^""]*)""");
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.Hosting.Tests (7)
DistributedApplicationTests.cs (4)
1944var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1963var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}")); 2024var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 2044var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}"));
ProjectResourceTests.cs (1)
965.ScrubLinesWithReplace(s => Regex.Replace(s, "FROM projectname:temp-.*", "FROM projectname:temp-"));
Publishing\ResourceContainerImageManagerTests.cs (1)
1251.ScrubLinesWithReplace(line => Regex.Replace(line, "FROM program:temp-.*", "FROM program:temp-"));
WaitForTests.cs (1)
581Assert.Contains(logs, log => Regex.IsMatch(log.Message, @"(?i).*resource.*nginx.*failed.*"));
Aspire.Hosting.TestUtilities (3)
Helpers\KubernetesHelper.cs (1)
34if (Regex.IsMatch(name, resourceNamePattern) && ready(r))
Utils\ContainerRuntimeLogPatterns.cs (2)
92private static partial Regex PodmanImagePullFailureRegex(); 95private static partial Regex PodmanBuildStepRegex();
Aspire.Microsoft.Azure.Cosmos (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Microsoft.Data.SqlClient (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Microsoft.Data.SqlClient.Tests (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Milvus.Client (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.MongoDB.Driver (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.MongoDB.EntityFrameworkCore (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.MySqlConnector (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.NATS.Net (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Npgsql (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.OpenAI (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Oracle.EntityFrameworkCore (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Playground.Tests (3)
AppHostTests.cs (1)
52var regex = new Regex(wait.Pattern);
ProjectSpecificTests.cs (1)
87output = Regex.Replace(output, pattern: @"(?<=http:\/\/127\.0\.0\.1:)\d+", replacement: "*");
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Qdrant.Client (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.RabbitMQ.Client (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Seq (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.StackExchange.Redis (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Templates.Tests (10)
AppHostTemplateTests.cs (1)
39private static partial Regex AppHostPackageReferenceRegex();
BuildAndRunTemplateTests.cs (2)
251private static partial Regex AppHostVersionRegex(); 254private static partial Regex ProjectClosingTagRegex();
LocalhostTldHostnameTests.cs (1)
13private static partial Regex HostnamePattern();
TemplateTestsBase.cs (2)
16private static partial Regex CommentLineRegex(); 20private static partial Regex GeneratedClassNameFixupRegex();
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
120.Or(row.Locator(StateTextSelector).Filter(new() { HasTextRegex = new Regex($"^{Regex.Escape(state)}$") }));
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled); 569private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.TestTools (1)
GitHubCli.cs (1)
380var fileName = Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
cdac-build-tool (6)
ContractDescriptorSourceFileEmitter.cs (2)
27private static partial Regex FindTemplatePlaceholderRegex { get; } 78private static partial Regex CStringEscape { get; }
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (4)
23private static partial global::System.Text.RegularExpressions.Regex FindTemplatePlaceholderRegex => global::System.Text.RegularExpressions.Generated.FindTemplatePlaceholderRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex CStringEscape => global::System.Text.RegularExpressions.Generated.CStringEscape_1.Instance; 322internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 325internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
40private static partial Regex BlankLinesInDocComment();
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1611private static partial Regex TimeSpanRegex();
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet-aot (8)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (4)
34private static partial global::System.Text.RegularExpressions.Regex GetFrameRegex() => global::System.Text.RegularExpressions.Generated.GetFrameRegex_0.Instance; 55private static partial global::System.Text.RegularExpressions.Regex GetInvalidJsonBackslashRegex() => global::System.Text.RegularExpressions.Generated.GetInvalidJsonBackslashRegex_1.Instance; 606internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 609internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
parent\dotnet\Commands\Test\MTP\Terminal\AnsiDetector.cs (1)
18private static readonly Regex[] TerminalsRegexes =
parent\dotnet\Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
100private static partial Regex GetFrameRegex();
parent\dotnet\Extensions\ParseResultExtensions.cs (1)
177Regex.Split(formatString, @"{[0-9]+}");
parent\dotnet\SlnFileFactory.cs (1)
151private static partial Regex GetInvalidJsonBackslashRegex();
dotnet-dev-certs (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (5)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
dotnet-Microsoft.XmlSerializer.Generator (1)
Sgen.cs (1)
629match = Regex.Match(reference, pattern);
dotnet-svcutil-lib (19)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
147private static volatile Regex s_outputRegWithFileAndLine; 148private static volatile Regex s_outputRegSimple;
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (2)
153private static volatile Regex s_outputReg; 3282string[] lines = Regex.Split(fileStr, @"\r\n");
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (5)
882Regex regex = (Regex)restriction.Patterns[i]; 1353private static Regex s_languagePattern; 1355private static Regex LanguagePattern 1361Regex langRegex = new Regex("^([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*$", RegexOptions.None);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (4)
67private static Dictionary<string, Regex> s_regexs = new Dictionary<string, Regex>(); 68static internal Regex NewRegex(string pattern) 70Regex regex;
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
311private static volatile Regex s_encodeCharPattern; 312private static volatile Regex s_decodeCharPattern;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
2314if (Regex.IsMatch(internalsVisibleAttributeAssemblyName, Globals.SimpleSRSInternalsVisiblePattern) || 2315Regex.IsMatch(internalsVisibleAttributeAssemblyName, Globals.FullSRSInternalsVisiblePattern))
dotnet-svcutil-lib.Tests (2)
FixupUtil.cs (1)
150updatedText = Regex.Replace(updatedText, target, value, regexOptions);
ProjectUtils.cs (1)
151sw2.Write(System.Text.RegularExpressions.Regex.Replace(csprojStr, @"<ItemGroup>\s+<PackageReference Include=""System.ServiceModel[\S\s]+ItemGroup>", ""));
GenerateDocumentationAndConfigFiles (8)
Program.cs (3)
585description = Regex.Replace(description, "(\r?\n)", "$1$1"); 590description = Regex.Replace(description, @"(?:http|ftp)s?:\/\/[^\s\]""']*(?:\/|[^\s\]""'\W])", "<$0>"); 618=> Regex.Replace(text, "(<.+?>)", "\\$1").Replace("*", @"\*");
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (4)
120if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 131if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 140if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 151if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
GenerateTemplateManifest (3)
TemplateRestorePlan.cs (3)
104(Regex.IsMatch(relevant, $@"\b{Regex.Escape(name)}\b") || 155var match = Regex.Match(directive, @"^#:(sdk|package|property)\s+([^@=\s]+)[@=](.+)$");
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
290if (!string.IsNullOrWhiteSpace(_context.FileName) && !Regex.IsMatch(_context.FileName, "^([A-Za-z0-9-_]+)$"))
ILCompiler.Compiler (2)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (2)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav) 250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
ILCompiler.ReadyToRun (2)
parent\parent\Common\Compiler\ProcessLinkerXmlBase.cs (2)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav) 250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
illink (8)
Infrastructure.Tests (25)
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
987var fileName = System.Text.RegularExpressions.Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (1)
204var fileName = Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
MicrosoftTestingPlatformTests.cs (2)
82var options = Regex.Matches(arguments, @"--[\w-]+").Select(match => match.Value).Distinct().ToArray(); 86Assert.Matches($@"(?m)^\s+{Regex.Escape(option)}\s*$", result.Output);
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (2)
29private static readonly Regex s_standaloneLiteral = new( 36private static readonly Regex s_anyPartitionTrait = new(
PowerShellScripts\ValidateNpmReleaseAliasesTests.cs (2)
195var withoutAnsi = Regex.Replace(output, @"\u001b\[[0-9;]*m", string.Empty); 196return Regex.Replace(withoutAnsi.Replace("|", " "), @"\s+", " ");
TestTriggerMap\SelectTestsAcceptanceTests.cs (1)
1366return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")
TestTriggerMap\SelectTestsCliTests.cs (7)
527var testProjectPaths = System.Text.RegularExpressions.Regex 547var deploymentProject = System.Text.RegularExpressions.Regex.Match( 953Assert.False(Regex.IsMatch(normalized, @"\bneeds(?:\.(?:[a-zA-Z0-9_-]+|\*))*\["), 957var gateNames = Regex.Matches(normalized, @"\brun_[a-zA-Z0-9_-]*"); 958var references = Regex.Matches(normalized, @"\bneeds\.([a-zA-Z0-9_-]+)\.outputs\.(run_[a-z0-9_]+)(?![a-zA-Z0-9_-])"); 985var mapping = Regex.Match(NormalizeWorkflowExpression(expression.ToString()), 1007return Regex.Replace(expression, @"'(?:[^']|'')*'|\[\s*'(?<property>[a-zA-Z_][a-zA-Z0-9_-]*)'\s*\]|\s+", match =>
TestTriggerMap\TestTriggerMapTests.cs (2)
189return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"") 1161var runVars = System.Text.RegularExpressions.Regex
tools\GenerateCITimeline\TimelineRenderer.cs (2)
152private static partial Regex MatrixParamsRegex(); 155private static partial Regex TestsPrefixRegex();
WorkflowScripts\AutoSecWorkflowTests.cs (5)
4572Regex.Matches(approvalInputs, "^ ([a-z_]+):\r?$", RegexOptions.Multiline).Select(match => match.Groups[1].Value).Order(StringComparer.Ordinal)); 4627Assert.Equal(2, Regex.Matches(source, "^ patch-format: am\r?$", RegexOptions.Multiline).Count); 4628var compiledPatchFormats = Regex.Matches(compiled, "patch_format\\\\\":\\\\\"([a-z]+)\\\\\"").Select(match => match.Groups[1].Value).ToArray(); 4815var start = Regex.Match(text, startPattern, options); 4817var end = Regex.Match(text[(start.Index + start.Length)..], endPattern, options);
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.Agents.AI.ProjectTemplates.Tests (7)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (2)
24private readonly Regex _regex; 28var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
Microsoft.AspNetCore.Authentication.Negotiate (9)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
21internal static partial global::System.Text.RegularExpressions.Regex DistinguishedNameSeparatorRegex => global::System.Text.RegularExpressions.Generated.DistinguishedNameSeparatorRegex_0.Instance; 37/// <summary>Custom <see cref="Regex"/>-derived type for the DistinguishedNameSeparatorRegex method.</summary> 56/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 59/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 168/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 172/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 173internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 176internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Internal\LdapAdapter.cs (1)
31internal static partial Regex DistinguishedNameSeparatorRegex { get; }
Microsoft.AspNetCore.Components (14)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex AlphaRouteRegex => global::System.Text.RegularExpressions.Generated.AlphaRouteRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the AlphaRouteRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 136/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 140/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 144internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Http\Routing\src\Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex AlphaRouteRegex { get; }
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (5)
27private readonly Func<Regex>? _regexFactory; 28private Regex? _constraint; 33/// <param name="regex">A <see cref="Regex"/> instance to use as a constraint.</param> 34public RegexRouteConstraint(Regex regex) 62public Regex Constraint
Microsoft.AspNetCore.Components.Testing (3)
Infrastructure\ResourceLock.cs (3)
33private readonly Regex _urlPattern; 39ResourceLock(IPage page, Regex urlPattern) 52public static async Task<ResourceLock> CreateAsync(IPage page, Regex urlPattern)
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
DebugProxyLauncher.cs (3)
19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (5)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\JsonTranscodingRouteAdapter.cs (2)
122var constraint = suffix.Length > 0 ? $":regex({Regex.Escape(suffix)}$)" : string.Empty; 184tempSegments[i] = $"{{**__Discard_{i}:regex({Regex.Escape($":{pattern.Verb}")}$)}}";
parent\Shared\Legacy.cs (2)
52private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 61private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Rewrite (8)
ApacheModRewrite\Tokenizer.cs (1)
109tokens[i] = Regex.Unescape(trimmed);
IISUrlRewrite\UriMatchCondition.cs (1)
27var regex = new Regex(
IISUrlRewrite\UrlRewriteRuleBuilder.cs (2)
49var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout); 54var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
RedirectRule.cs (1)
14public Regex InitialMatch { get; }
RewriteRule.cs (1)
14public Regex InitialMatch { get; }
UrlMatches\RegexMatch.cs (2)
10private readonly Regex _match; 12public RegexMatch(Regex match, bool negate)
Microsoft.AspNetCore.Routing (15)
Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex AlphaRouteRegex { get; }
Constraints\RegexRouteConstraint.cs (5)
27private readonly Func<Regex>? _regexFactory; 28private Regex? _constraint; 33/// <param name="regex">A <see cref="Regex"/> instance to use as a constraint.</param> 34public RegexRouteConstraint(Regex regex) 62public Regex Constraint
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex AlphaRouteRegex => global::System.Text.RegularExpressions.Generated.AlphaRouteRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the AlphaRouteRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 136/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 140/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 144internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
RouteConstraintBuilder.cs (1)
93/// <c>^(Product[0-9]+)</c>. See <see cref="System.Text.RegularExpressions.Regex"/> for more details.
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.Server.Kestrel.Core (21)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (16)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 86/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslVersionRegex method.</summary> 105/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 108/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 266/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 269/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 380/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 399/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 402/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 605/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 609/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 610internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 613internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Microsoft.AspNetCore.SpaServices.Extensions (2)
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
Util\EventedStreamReader.cs (1)
33public Task<Match> WaitForMatch(Regex regex)
Microsoft.Build (89)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (2)
24public SdkResolverManifest(string DisplayName, string Path, Regex ResolvableSdkRegex) 47public Regex ResolvableSdkRegex { get; private set; }
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
28private static partial Regex SectionMatcherRegex { get; } 31private static partial Regex PropertyMatcherRegex { get; }
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (4)
27internal Regex Regex { get; } 30Regex regex, 250sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 360sb.Append(Regex.Escape(currentChar.ToString()));
Construction\ProjectRootElement.cs (1)
68private static partial Regex XmlDeclarationRegex { get; }
Construction\Solution\SolutionFile.cs (2)
65private static partial Regex CrackProjectLineRegex { get; } 68private static partial Regex CrackPropertyLineRegex { get; }
Definition\ToolsetReader.cs (2)
208var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander\WellKnownFunctions.cs (3)
902else if (receiverType == typeof(Regex)) 904if (string.Equals(methodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 908returnVal = Regex.Replace(arg1, arg2, arg3);
Evaluation\IntrinsicFunctions.cs (1)
46private static partial Regex RegistrySdkRegex { get; }
Evaluation\PropertyFunctionReceiver.cs (1)
44typeof(Uri), typeof(Regex), typeof(Match), typeof(Group), typeof(Capture),
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (56)
35private static partial global::System.Text.RegularExpressions.Regex SectionMatcherRegex => global::System.Text.RegularExpressions.Generated.SectionMatcherRegex_0.Instance; 66private static partial global::System.Text.RegularExpressions.Regex PropertyMatcherRegex => global::System.Text.RegularExpressions.Generated.PropertyMatcherRegex_1.Instance; 126private static partial global::System.Text.RegularExpressions.Regex TerminalLoggerArgPattern => global::System.Text.RegularExpressions.Generated.TerminalLoggerArgPattern_2.Instance; 160private static partial global::System.Text.RegularExpressions.Regex VerbosityArgPattern => global::System.Text.RegularExpressions.Generated.VerbosityArgPattern_3.Instance; 211private static partial global::System.Text.RegularExpressions.Regex TerminalLoggerParametersArgPattern => global::System.Text.RegularExpressions.Generated.TerminalLoggerParametersArgPattern_4.Instance; 262private static partial global::System.Text.RegularExpressions.Regex ConsoleLoggerParametersArgPattern => global::System.Text.RegularExpressions.Generated.ConsoleLoggerParametersArgPattern_5.Instance; 306private static partial global::System.Text.RegularExpressions.Regex ItemVectorTransformRegex => global::System.Text.RegularExpressions.Generated.ItemVectorTransformRegex_6.Instance; 343private static partial global::System.Text.RegularExpressions.Regex ItemVectorTransformRawRegex => global::System.Text.RegularExpressions.Generated.ItemVectorTransformRawRegex_7.Instance; 368private static partial global::System.Text.RegularExpressions.Regex XmlDeclarationRegex => global::System.Text.RegularExpressions.Generated.XmlDeclarationRegex_8.Instance; 411private static partial global::System.Text.RegularExpressions.Regex CrackProjectLineRegex => global::System.Text.RegularExpressions.Generated.CrackProjectLineRegex_9.Instance; 436private static partial global::System.Text.RegularExpressions.Regex CrackPropertyLineRegex => global::System.Text.RegularExpressions.Generated.CrackPropertyLineRegex_10.Instance; 522private static partial global::System.Text.RegularExpressions.Regex RegistrySdkRegex => global::System.Text.RegularExpressions.Generated.RegistrySdkRegex_11.Instance; 542private static partial global::System.Text.RegularExpressions.Regex XmlnsPattern => global::System.Text.RegularExpressions.Generated.XmlnsPattern_12.Instance; 558/// <summary>Custom <see cref="Regex"/>-derived type for the SectionMatcherRegex method.</summary> 577/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 580/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 973/// <summary>Custom <see cref="Regex"/>-derived type for the PropertyMatcherRegex method.</summary> 992/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 995/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1417/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerArgPattern method.</summary> 1438/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1441/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1719/// <summary>Custom <see cref="Regex"/>-derived type for the VerbosityArgPattern method.</summary> 1740/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1743/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1964/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerParametersArgPattern method.</summary> 1985/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1988/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2202/// <summary>Custom <see cref="Regex"/>-derived type for the ConsoleLoggerParametersArgPattern method.</summary> 2223/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2226/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2440/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRegex method.</summary> 2461/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2464/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2834/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRawRegex method.</summary> 2853/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2856/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3146/// <summary>Custom <see cref="Regex"/>-derived type for the XmlDeclarationRegex method.</summary> 3165/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3168/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3354/// <summary>Custom <see cref="Regex"/>-derived type for the CrackProjectLineRegex method.</summary> 3375/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3378/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3824/// <summary>Custom <see cref="Regex"/>-derived type for the CrackPropertyLineRegex method.</summary> 3845/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3848/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4091/// <summary>Custom <see cref="Regex"/>-derived type for the RegistrySdkRegex method.</summary> 4110/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4113/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4262/// <summary>Custom <see cref="Regex"/>-derived type for the XmlnsPattern method.</summary> 4281/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4284/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4387/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 4391/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 4392internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 4395internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Logging\TerminalLogger\TerminalLogger.cs (4)
1889private static partial Regex TerminalLoggerArgPattern { get; } 1891private static partial Regex VerbosityArgPattern { get; } 1893private static partial Regex TerminalLoggerParametersArgPattern { get; } 1895private static partial Regex ConsoleLoggerParametersArgPattern { get; }
Resources\Constants.cs (2)
187[DynamicDependency(PropertyFunctionMembers, typeof(Regex))] 298availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple<string, Type>(null, typeof(Regex)));
Utilities\EngineFileUtilities.cs (6)
25private static List<Regex>? s_lazyWildCardExpansionRegexes; 571private static List<Regex> PopulateRegexFromEnvironment() 576return new List<Regex>(0); 580List<Regex> regexes = new List<Regex>(); 583Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\ProjectWriter.cs (2)
54private static partial Regex ItemVectorTransformRegex { get; } 57private static partial Regex ItemVectorTransformRawRegex { get; }
Utilities\Utilities.cs (1)
312private static partial Regex XmlnsPattern { get; }
Microsoft.Build.Framework (54)
BuildEnvironmentHelper.cs (2)
204Regex.IsMatch(processName, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 278Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (40)
49private static partial global::System.Text.RegularExpressions.Regex CommandLineNodeModeRegex => global::System.Text.RegularExpressions.Generated.CommandLineNodeModeRegex_0.Instance; 123private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression_1.Instance; 173private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression2 => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression2_2.Instance; 204private static partial global::System.Text.RegularExpressions.Regex FilenameLocationFromOrigin => global::System.Text.RegularExpressions.Generated.FilenameLocationFromOrigin_3.Instance; 226private static partial global::System.Text.RegularExpressions.Regex LineFromLocation => global::System.Text.RegularExpressions.Generated.LineFromLocation_4.Instance; 251private static partial global::System.Text.RegularExpressions.Regex LineLineFromLocation => global::System.Text.RegularExpressions.Generated.LineLineFromLocation_5.Instance; 276private static partial global::System.Text.RegularExpressions.Regex LineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColFromLocation_6.Instance; 304private static partial global::System.Text.RegularExpressions.Regex LineColColFromLocation => global::System.Text.RegularExpressions.Generated.LineColColFromLocation_7.Instance; 335private static partial global::System.Text.RegularExpressions.Regex LineColLineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColLineColFromLocation_8.Instance; 351/// <summary>Custom <see cref="Regex"/>-derived type for the CommandLineNodeModeRegex method.</summary> 372/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 375/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 687/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression method.</summary> 708/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 711/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1540/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression2 method.</summary> 1561/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1564/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1898/// <summary>Custom <see cref="Regex"/>-derived type for the FilenameLocationFromOrigin method.</summary> 1919/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1922/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2195/// <summary>Custom <see cref="Regex"/>-derived type for the LineFromLocation method.</summary> 2216/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2219/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2317/// <summary>Custom <see cref="Regex"/>-derived type for the LineLineFromLocation method.</summary> 2338/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2341/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2472/// <summary>Custom <see cref="Regex"/>-derived type for the LineColFromLocation method.</summary> 2493/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2496/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2627/// <summary>Custom <see cref="Regex"/>-derived type for the LineColColFromLocation method.</summary> 2648/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2651/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2811/// <summary>Custom <see cref="Regex"/>-derived type for the LineColLineColFromLocation method.</summary> 2832/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2835/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3024/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 3028/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 3029internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 3032internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Logging\AnsiDetector.cs (1)
16private static readonly Regex[] terminalsRegexes =
NodeMode.cs (1)
158private static partial System.Text.RegularExpressions.Regex CommandLineNodeModeRegex { get; }
Telemetry\CrashTelemetry.cs (1)
173private static readonly Regex FilePathPattern = new(
Utilities\AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
31directoryPath = Regex.Replace(directoryPath, "%VSINSTALLDIR%",
Utilities\CanonicalError.cs (8)
135private static partial Regex OriginCategoryCodeTextExpression { get; } 138private static partial Regex OriginCategoryCodeTextExpression2 { get; } 141private static partial Regex FilenameLocationFromOrigin { get; } 144private static partial Regex LineFromLocation { get; } 147private static partial Regex LineLineFromLocation { get; } 150private static partial Regex LineColFromLocation { get; } 153private static partial Regex LineColColFromLocation { get; } 156private static partial Regex LineColLineColFromLocation { get; }
Microsoft.Build.Tasks.CodeAnalysis (7)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (7)
54private static readonly Regex s_originCategoryCodeTextExpression = new Regex 76private static readonly Regex s_filenameLocationFromOrigin = new Regex(@" 88private static readonly Regex s_lineFromLocation = new Regex(@" 96private static readonly Regex s_lineLineFromLocation = new Regex(@" 106private static readonly Regex s_lineColFromLocation = new Regex(@" 116private static readonly Regex s_lineColColFromLocation = new Regex(@" 128private static readonly Regex s_lineColLineColFromLocation = new Regex(@"
Microsoft.Build.Tasks.Core (33)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (2)
26private static readonly Lazy<Regex> s_crackAssemblyFoldersFromConfigSentinel = new Lazy<Regex>(
BootstrapperUtil\BuildMessage.cs (1)
20private static partial Regex MsbuildMessageCodePattern { get; }
Exec.cs (1)
426match = Regex.IsMatch(singleLine, regularExpression);
FindInvalidProjectReferences.cs (1)
29private static partial Regex PlatformMonikerRegex { get; }
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (24)
19private static partial global::System.Text.RegularExpressions.Regex MsbuildMessageCodePattern => global::System.Text.RegularExpressions.Generated.MsbuildMessageCodePattern_0.Instance; 52private static partial global::System.Text.RegularExpressions.Regex PlatformMonikerRegex => global::System.Text.RegularExpressions.Generated.PlatformMonikerRegex_1.Instance; 96private static partial global::System.Text.RegularExpressions.Regex AssemblyNameRegex => global::System.Text.RegularExpressions.Generated.AssemblyNameRegex_2.Instance; 126private static partial global::System.Text.RegularExpressions.Regex AssemblyVersionRegex => global::System.Text.RegularExpressions.Generated.AssemblyVersionRegex_3.Instance; 160private static partial global::System.Text.RegularExpressions.Regex SdkReferenceFormatRegex => global::System.Text.RegularExpressions.Generated.SdkReferenceFormatRegex_4.Instance; 176/// <summary>Custom <see cref="Regex"/>-derived type for the MsbuildMessageCodePattern method.</summary> 195/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 198/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Custom <see cref="Regex"/>-derived type for the PlatformMonikerRegex method.</summary> 315/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 318/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 462/// <summary>Custom <see cref="Regex"/>-derived type for the AssemblyNameRegex method.</summary> 483/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 486/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1167/// <summary>Custom <see cref="Regex"/>-derived type for the AssemblyVersionRegex method.</summary> 1186/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1189/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1365/// <summary>Custom <see cref="Regex"/>-derived type for the SdkReferenceFormatRegex method.</summary> 1386/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1389/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1533/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 1537/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 1538internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 1541internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ManifestUtil\AssemblyIdentity.cs (2)
67private static partial Regex AssemblyNameRegex { get; } 179Regex re = AssemblyNameRegex;
NativeMethods.cs (1)
239private static partial Regex AssemblyVersionRegex { get; }
ResolveSDKReference.cs (1)
43private static partial Regex SdkReferenceFormatRegex { get; }
Microsoft.Build.Utilities.Core (4)
CommandLineBuilder.cs (4)
145private Regex _allowedUnquoted; 152private Regex _definitelyNeedQuotes; 157private Regex DefinitelyNeedQuotes => _definitelyNeedQuotes ??= 163private Regex AllowedUnquoted => _allowedUnquoted ??=
Microsoft.CodeAnalysis (21)
CommandLine\AnalyzerConfig.cs (2)
30private static partial Regex GetSectionMatcherRegex(); 33private static partial Regex GetPropertyMatcherRegex();
CommandLine\AnalyzerConfig.SectionNameMatching.cs (6)
20private static readonly ConcurrentDictionary<string, Regex> s_regexMap = []; 26internal Regex Regex { get; } 29Regex regex, 127var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled)); 257sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 367sb.Append(Regex.Escape(currentChar.ToString()));
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (12)
35private static partial global::System.Text.RegularExpressions.Regex GetSectionMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetSectionMatcherRegex_0.Instance; 66private static partial global::System.Text.RegularExpressions.Regex GetPropertyMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetPropertyMatcherRegex_1.Instance; 82/// <summary>Custom <see cref="Regex"/>-derived type for the GetSectionMatcherRegex method.</summary> 101/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 104/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 497/// <summary>Custom <see cref="Regex"/>-derived type for the GetPropertyMatcherRegex method.</summary> 516/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 519/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 941/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 945/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 946internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 949internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
SourceGeneration\AdditionalSourcesCollection.cs (1)
28private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (9)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (4)
351if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase) || 352Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 356else if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase) || 357Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
MetaAnalyzers\ReleaseTrackingHelper.cs (4)
120if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 131if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 140if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 151if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.CodeAnalysis.Features (15)
CodeFixes\Configuration\ConfigurationUpdater.cs (3)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr);
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); 117var result = Regex.Replace(numericText, $"(.{{{interval}}})", "_$1", RegexOptions.RightToLeft);
DocumentationComments\CopilotDocumentationCommentGenerator.cs (1)
203copilotText = Regex.Replace(copilotText, @"\r?\n", " ");
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (2)
23private readonly Regex _regex; 27var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
207private static readonly Regex s_validNumberRegex =
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
37var regexType = compilation.GetTypeByMetadataName(typeof(Regex).FullName!); 49/// Finds public, static methods in <see cref="Regex"/> that have a parameter called 50/// 'pattern'. These are helpers (like <see cref="Regex.Replace(string, string, string)"/> 118if (syntaxFacts.StringComparer.Compare(nameof(Regex), name) == 0)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.NetAnalyzers (3)
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (2)
49private static readonly Regex s_AntiForgeryAttributeRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute$", RegexOptions.Compiled); 50private static readonly Regex s_AntiForgeryRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*$", RegexOptions.Compiled);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\AdditionalFileProvider.cs (1)
50=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
AbstractResxGenerator.cs (2)
864private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 865private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (9)
PatternMatching\RegexPatternMatcher.cs (5)
16/// A pattern matcher that uses a compiled <see cref="Regex"/> for matching. Performs 22Regex caseInsensitiveRegex, Regex caseSensitiveRegex, bool includeMatchedSpans, CultureInfo? culture) 44var caseInsensitive = new Regex(pattern, commonOptions | RegexOptions.IgnoreCase, timeout); 45var caseSensitive = new Regex(pattern, commonOptions, timeout);
Rename\RenameUtilities.cs (2)
290var regex = GetRegexForMatch(matchText); 327public static Regex GetRegexForMatch(string matchText)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
445var regex = RenameUtilities.GetRegexForMatch(renameText);
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (7)
TextFieldParser.cs (7)
29private readonly Regex _delimiterRegex; 33public QuoteDelimitedFieldBuilder(Regex delimiterRegex, string spaceChars) 147private Regex _delimiterRegex; 149private Regex _delimiterWithEndCharsRegex; 153private Regex _beginQuotesRegex; 301private Regex BeginQuotesRegex 1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.Data.Analysis.Tests (7)
parent\parent\src\Microsoft.Data.Analysis\TextFieldParser.cs (7)
29private readonly Regex _delimiterRegex; 33public QuoteDelimitedFieldBuilder(Regex delimiterRegex, string spaceChars) 147private Regex _delimiterRegex; 149private Regex _delimiterWithEndCharsRegex; 153private Regex _beginQuotesRegex; 301private Regex BeginQuotesRegex 1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.Diagnostics.NETCore.Client (1)
DiagnosticsClient\DiagnosticsClient.cs (1)
453Match match = Regex.Match(fileName, PidIpcEndpoint.DiagnosticsPortPattern);
Microsoft.DotNet.ApiCompat.Task (3)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (3)
13private readonly (Regex Regex, string ReplacementString)[] _patterns; 31_patterns = new (Regex Regex, string ReplacementString)[rawPatterns.Length]; 46foreach ((Regex regex, string replacementString) in _patterns)
Microsoft.DotNet.Arcade.Sdk (4)
src\CheckRequiredDotNetVersion.cs (1)
78var match = Regex.Match(globalJson, $@"""dotnet""\s*:\s*""([^""]+)""");
src\GenerateResxSource.cs (2)
493private static readonly Regex _namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 494private static readonly Regex _numberParameterMatcher = new Regex(@"\{(\d+)\}", RegexOptions.Compiled);
src\LocateDotNet.cs (1)
65var match = Regex.Match(globalJson, @"""dotnet""\s*:\s*""([^""]+)""");
Microsoft.DotNet.Build.Manifest (2)
BuildModelFactory.cs (2)
62private readonly Regex LegacyRepositoryUriPattern = new Regex( 234string replacementUri = $"{Regex.Unescape(AzureDevOpsHostPattern)}/{m.Groups["account"].Value}";
Microsoft.DotNet.Build.Tasks.Installers (4)
src\CreateWixBuildWixpack.cs (3)
250var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>"); 666var regex = new Regex(@"<\?include\s+([^\s\?>]+)\s*\?>", RegexOptions.IgnoreCase); 980var eqMatch = Regex.Match(
src\GenerateCurrentVersion.cs (1)
99Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Build.Tasks.Workloads (2)
Utils.cs (1)
112string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
WorkloadPackageBase.cs (1)
265if (exclusionPatterns.Any(pattern => Regex.IsMatch(file, pattern)))
Microsoft.DotNet.Cli.Definitions (9)
Commands\Test\TestCommandDefinition.MicrosoftTestingPlatform.cs (1)
367private static partial Regex TimeoutPattern();
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
88private static partial global::System.Text.RegularExpressions.Regex TimeoutPattern() => global::System.Text.RegularExpressions.Generated.TimeoutPattern_0.Instance; 105/// <summary>Custom <see cref="Regex"/>-derived type for the TimeoutPattern method.</summary> 125/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 128/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 982/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 986/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 987internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 990internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Microsoft.DotNet.Cli.InternalMicrosoft (21)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (17)
22private static partial global::System.Text.RegularExpressions.Regex AliasRegex() => global::System.Text.RegularExpressions.Generated.AliasRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex DomainRegex() => global::System.Text.RegularExpressions.Generated.AliasRegex_0.Instance; 74private static partial global::System.Text.RegularExpressions.Regex GitHubTokenRegex() => global::System.Text.RegularExpressions.Generated.GitHubTokenRegex_1.Instance; 107private static partial global::System.Text.RegularExpressions.Regex GitHubTokenValueRegex() => global::System.Text.RegularExpressions.Generated.GitHubTokenValueRegex_2.Instance; 123/// <summary>Custom <see cref="Regex"/>-derived type for the AliasRegex method.</summary> 141/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 144/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 231/// <summary>Custom <see cref="Regex"/>-derived type for the GitHubTokenRegex method.</summary> 249/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 252/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 428/// <summary>Custom <see cref="Regex"/>-derived type for the GitHubTokenValueRegex method.</summary> 448/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 451/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 756/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 760/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 761internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 764internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Internal\InternalMicrosoftDetectionUtilities.cs (4)
167private static partial Regex AliasRegex(); 170private static partial Regex DomainRegex(); 173private static partial Regex GitHubTokenRegex(); 176private static partial Regex GitHubTokenValueRegex();
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
373return Regex.Escape(Path.DirectorySeparatorChar.ToString());
Microsoft.DotNet.HotReload.Utils.Generator (1)
EditAndContinueCapabilitiesParser.cs (1)
12static public readonly Regex capabilitiesTokenizer = new (@"^\s*(?:(\S+)\s+)*(\S+)?$", RegexOptions.CultureInvariant);
Microsoft.DotNet.HotReload.Watch (11)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (5)
24private static partial global::System.Text.RegularExpressions.Regex GetNowListeningOnRegex() => global::System.Text.RegularExpressions.Generated.GetNowListeningOnRegex_0.Instance; 47private static partial global::System.Text.RegularExpressions.Regex GetAspireDashboardUrlRegex() => global::System.Text.RegularExpressions.Generated.GetAspireDashboardUrlRegex_1.Instance; 74private static partial global::System.Text.RegularExpressions.Regex GetBuildDiagnosticRegex() => global::System.Text.RegularExpressions.Generated.GetBuildDiagnosticRegex_2.Instance; 701internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 704internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Process\WebServerProcessStateObserver.cs (4)
15private static readonly Regex s_nowListeningRegex = GetNowListeningOnRegex(); 16private static readonly Regex s_aspireDashboardUrlRegex = GetAspireDashboardUrlRegex(); 19private static partial Regex GetNowListeningOnRegex(); 22private static partial Regex GetAspireDashboardUrlRegex();
UI\BuildOutput.cs (2)
11private static readonly Regex s_buildDiagnosticRegex = GetBuildDiagnosticRegex(); 14private static partial Regex GetBuildDiagnosticRegex();
Microsoft.DotNet.ProjectTools (11)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
22private static partial global::System.Text.RegularExpressions.Regex MSBuildPropertyRegex() => global::System.Text.RegularExpressions.Generated.MSBuildPropertyRegex_0.Instance; 38/// <summary>Custom <see cref="Regex"/>-derived type for the MSBuildPropertyRegex method.</summary> 56/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 59/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 156/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 160/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 161internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 164internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
LaunchSettings\LaunchProfileParser.cs (1)
19private static partial Regex MSBuildPropertyRegex();
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.DotNet.SourceBuild.Tasks (3)
src\UsageReport\UsagePattern.cs (2)
26public Regex CreateRegex() 36string regex = Regex.Escape(IdentityGlob).Replace("\\*", ".*");
src\WriteBuildOutputProps.cs (1)
19private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.Extensions.AI.Abstractions (4)
ChatCompletion\ChatResponseFormat.cs (1)
98private static partial Regex InvalidNameCharsRegex();
Functions\AIFunctionFactory.cs (3)
1291private static partial Regex PotentiallyJsonRegex(); 1335private static partial Regex CompilerGeneratedNameRegex(); 1345private static partial Regex InvalidNameCharsRegex();
Microsoft.Extensions.AI.Evaluation (10)
Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 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 (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 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.Quality (1)
EvaluationMetricExtensions.cs (1)
117Match match = Regex.Match(text, $@"<{tagName}>(?<value>.*?)</{tagName}>", Options);
Microsoft.Extensions.AI.Evaluation.Reporting (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 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.Tests (1)
SerializationChainingTests.cs (1)
52jsonFromElement = Regex.Replace(jsonFromElement, @"\s+", "");
Microsoft.Extensions.AI.Evaluation.Safety (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 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.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
587Regex.IsMatch(response.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase),
VerbatimHttpHandler.cs (1)
99return Regex.Replace(text, @"\s*", string.Empty);
VerbatimMultiPartHttpHandler.cs (2)
158return Regex.Replace(input, @"[^a-zA-Z0-9_ .,!?\r\n""=;\//\[\]-]", ""); 219Regex.Replace(text, @"\s*", string.Empty);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
885private static partial Regex InvalidAuthorNameRegex();
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIConversionTests.cs (1)
2268private static string RemoveWhitespace(string input) => Regex.Replace(input, @"\s+", "");
Microsoft.Extensions.AI.Templates.Tests (7)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
1000private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Image\OpenTelemetryImageGeneratorTests.cs (1)
168static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
1062private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
150static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Microsoft.Extensions.Configuration.Binder.SourceGeneration (2)
Emitter\CoreBindingHelpers.cs (2)
21private static readonly Regex s_arrayBracketsRegex = new(Regex.Escape("[]"));
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Linux\Resources\HardcodedValueFileSystem.cs (1)
40.Select(x => Regex.Match(x, pattern, RegexOptions.IgnoreCase))
Microsoft.Extensions.Http.Diagnostics (2)
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
19public static partial Regex MakeRouteRegex();
Http\HttpDependencyMetadataResolver.cs (1)
33private static readonly Regex _routeRegex = DownstreamDependencyMetadataManagerRegex.MakeRouteRegex();
Microsoft.Extensions.VectorData.ConformanceTests (1)
TestSuiteImplementationTests.cs (1)
40.Where(t => Regex.IsMatch(t.Name, """Tests(`\d+)?$""") && t.IsAbstract && !t.IsSealed && !t.IsInterface);
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Logging.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Maui.Controls (4)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
WebView\WebView.cs (3)
302 var singleQuotes = Regex.Matches(js, @"(\\*?)'"); 324 js = Regex.Replace(js, @"(?<=[^\\])" + Regex.Escape(match), replacementStr);
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
12 static readonly Regex rxResourceFilenameValidation
Microsoft.ML.AutoML (1)
ColumnInference\ColumnTypeInference.cs (1)
219if (Regex.IsMatch(v, candidate, RegexOptions.IgnoreCase))
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.Core (2)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Utilities\Utils.cs (1)
589return Regex.Replace(value, "[^A-Za-z0-9]", "");
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
338var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (5)
Commands\EvaluateCommand.cs (2)
50private readonly Regex _loadNamePattern; 55bool isVector = false, Regex namePattern = null, string groupName = null, string nameFormat = null)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.StandardTrainers (1)
Standard\LinearPredictorUtils.cs (1)
86name = Regex.Replace(name, @"[^\w\d_]", "_");
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
560string[] minMaxRegex = Regex.Split(paramValue, "(?<=[^eE])-");
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tests (3)
OnnxConversionTest.cs (2)
451fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\""); 2290fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\"");
Transformers\TextFeaturizerTests.cs (1)
396var expected = Regex.Replace(data[0].A, "[,|_|'|\"|;|\\.]", "");
Microsoft.ML.Tokenizers (56)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (25)
50private static partial global::System.Text.RegularExpressions.Regex Cl100kBaseRegex() => global::System.Text.RegularExpressions.Generated.Cl100kBaseRegex_0.Instance; 91internal static partial global::System.Text.RegularExpressions.Regex P50kBaseRegex() => global::System.Text.RegularExpressions.Generated.P50kBaseRegex_1.Instance; 155internal static partial global::System.Text.RegularExpressions.Regex O200kBaseRegex() => global::System.Text.RegularExpressions.Generated.O200kBaseRegex_2.Instance; 174private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceOrPunctuationRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceOrPunctuationRegex_3.Instance; 193private static partial global::System.Text.RegularExpressions.Regex WordOrNonWordRegex() => global::System.Text.RegularExpressions.Generated.WordOrNonWordRegex_4.Instance; 210private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceRegex_5.Instance; 226/// <summary>Custom <see cref="Regex"/>-derived type for the Cl100kBaseRegex method.</summary> 244/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 676/// <summary>Custom <see cref="Regex"/>-derived type for the P50kBaseRegex method.</summary> 694/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 697/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1050/// <summary>Custom <see cref="Regex"/>-derived type for the O200kBaseRegex method.</summary> 1068/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1071/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1885/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceOrPunctuationRegex method.</summary> 1903/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1906/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2015/// <summary>Custom <see cref="Regex"/>-derived type for the WordOrNonWordRegex method.</summary> 2033/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2036/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2148/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceRegex method.</summary> 2166/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2169/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2250/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
Model\SentencePieceBaseModel.cs (3)
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); 106internal Regex? SpecialTokensRegex { get; }
Model\TiktokenTokenizer.cs (8)
1203private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1205private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1275private static partial Regex Cl100kBaseRegex(); 1278internal static partial Regex P50kBaseRegex(); 1281internal static partial Regex O200kBaseRegex(); 1305(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1465(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1505(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
Normalizer\SentencePieceNormalizationStep.cs (3)
28/// step. The steps rely on string-only BCL APIs (<see cref="Regex"/>, <see cref="string.Normalize(NormalizationForm)"/>, 406private readonly Regex? _regex; 408private ReplaceStep(string? literal, Regex? regex, string content)
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\PreTokenizer.cs (8)
32internal static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex) 50private static partial Regex WhiteSpaceOrPunctuationRegex(); 79private static partial Regex WordOrNonWordRegex(); 109private static partial Regex WhiteSpaceRegex(); 133internal static IEnumerable<(int Offset, int Length)> SplitText(ReadOnlySpan<char> text, Regex regex) 140static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, int textLength) 157internal static bool TryGetMatch(Regex regex, string text, int beginning, int length, out (int offset, int length) match) 178internal static bool TryGetMatch(Regex regex, scoped ReadOnlySpan<char> text, int beginning, int length, out (int offset, int length) match)
PreTokenizer\RegexPreTokenizer.cs (8)
18private readonly Regex? _specialTokensRegex; 19private readonly Regex _regex; 27public RegexPreTokenizer(Regex regex, IReadOnlyDictionary<string, int>? specialTokens) 39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 57static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex, Regex? specialTokensRegex) 108static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, Regex? specialTokensRegex, int textLength)
Microsoft.NET.Build.Containers (22)
AuthHandshakeMessageHandler.cs (1)
611private static partial Regex BearerParameterSplitter();
ContainerHelpers.cs (1)
37private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
DigestUtils.cs (2)
26private static readonly Dictionary<string, Regex> s_registeredAlgorithms = new(StringComparer.Ordinal) 193if (!s_registeredAlgorithms.TryGetValue(algorithm, out Regex? encodedPattern))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (3)
26private static partial global::System.Text.RegularExpressions.Regex BearerParameterSplitter() => global::System.Text.RegularExpressions.Generated.BearerParameterSplitter_0.Instance; 252internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 255internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ImageBuilder.cs (1)
29internal static Regex aspnetPortRegex = new(@"(?<scheme>\w+)://(?<domain>([*+]|).+):(?<port>\d+)");
ReferenceParser.cs (14)
98public static readonly Regex DomainRegexp = new(domain); 104public static readonly Regex AnchoredDomainRegexp = new(anchored(domain)); 114public static readonly Regex TagRegexp = new(tag); 126public static readonly Regex anchoredTagRegexp = new(anchoredTag); 172public static readonly Regex DigestRegexp = new(digestPat); 182public static readonly Regex AnchoredDigestRegexp = new(anchored( 203public static readonly Regex NameRegexp = new(namePat); 218public static readonly Regex anchoredNameRegexp = new(anchoredName); 236public static readonly Regex ReferenceRegexp = new(referencePat); 250public static readonly Regex IdentifierRegexp = new(identifier); 264public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 276private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 290private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier); 297private static string literal(string s) => Regex.Escape(s);
Microsoft.NET.Sdk.Publish.Tasks (5)
MsDeploy\VSMSDeployHostObject.cs (2)
54srcSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(Path.Combine(rootFolderOfFileToPublish, p.SourceFilePath)) + "$"); 63destSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(p.DestinationFilePath) + "$");
MsDeploy\VsMSDeployObject.cs (1)
189RegularExpressions.Regex match = new(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase);
Tasks\MsDeploy\CreateParameterFile.cs (1)
163metadataValue = $"^{Regex.Escape(metadataValue)}$";
WebConfigTelemetry.cs (1)
13private static readonly Lazy<Regex> s_crackProjectLine = new(
Microsoft.NET.Sdk.StaticWebAssets.Tasks (12)
JSModules\ApplyJsModules.cs (1)
122Regex.Replace(jsModuleCandidatePath, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
MergeConfigurationProperties.cs (1)
100metadataValue = Regex.Replace(metadataValue, ";{2,}", ";");
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
ScopedCss\ApplyCssScopes.cs (1)
128Regex.Replace(scopedCssCandidate.ItemSpec, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
ScopedCss\RewriteCss.cs (1)
27private static readonly Regex s_deepCombinatorRegex = new($@"^{DeepCombinatorText}\s*", RegexOptions.None, s_regexTimeout);
UpdateExternallyDefinedStaticWebAssets.cs (5)
154private bool TryInferFingerprint(Regex[] fingerprintExpressions, string relativePath, out string fingerprint, out string newRelativePath) 158var regex = fingerprintExpressions[i]; 182private static Regex[] CreateFingerprintExpressions(ITaskItem[] fingerprintInferenceExpressions) 193var result = new Regex[fingerprintInferenceExpressions.Length]; 198var regex = new Regex(pattern, regexOptions);
Microsoft.TemplateEngine.Cli (2)
TemplateInvoker.cs (2)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (2)
Mount\Archive\ZipFileDirectory.cs (2)
23string rx = Regex.Escape(pattern); 25Regex r = new Regex($"^{rx}$");
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (8)
Macros\BaseMacroConfig.cs (1)
156Regex.Match(string.Empty, regex);
Macros\RegexMacro.cs (1)
33value = Regex.Replace(value, stepInfo.Regex, stepInfo.Replacement);
Macros\RegexMatchMacro.cs (1)
30bool result = Regex.IsMatch(value, config.Pattern);
ValueForms\DefaultSafeNameValueFormFactory.cs (2)
18string workingValue = Regex.Replace(value, @"(^\s+|\s+$)", string.Empty); 19workingValue = Regex.Replace(workingValue, @"(((?<=\.)|^)(?=\d)|\W)", replacement);
ValueForms\KebabCaseValueFormFactory.cs (1)
21Regex pattern = new(@"(?:\p{Lu}\p{M}*)?(?:\p{Ll}\p{M}*)+|(?:\p{Lu}\p{M}*)+(?!\p{Ll})|\p{N}+|[^\p{C}\p{P}\p{Z}]+|[\u2700-\u27BF]");
ValueForms\ReplacementValueFormFactory.cs (2)
11public ReplacementValueFormSettings(Regex match, string? replacement) 17internal Regex Match { get; }
Microsoft.TemplateEngine.Utils (6)
InMemoryFileSystem.cs (6)
196Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 276Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 358Regex rx = new("^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$");
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\TimeSpanParser.cs (1)
11static readonly Regex Pattern = new(@"(?<value>^\d+(?:\.\d+)?)\s*(?<suffix>ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase);
Microsoft.TestPlatform.Filter.Source (1)
FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
Microsoft.VisualStudio.TestPlatform.Common (2)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
Utilities\RunSettingsProviderExtensions.cs (1)
100Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
44private static readonly Regex InvalidXmlCharsRegex = new(
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.VisualStudio.TestPlatform.ObjectModel (3)
Client\FilterOptions.cs (2)
23/// Gets or sets the optional regular expression replacement string. When this property is set, <see cref="System.Text.RegularExpressions.Regex.Replace(string, string, string)"/> 24/// will be called upon property value instead of <see cref="System.Text.RegularExpressions.Regex.Match(string)"/> before matching.
DataCollector\Common\FileHelper.cs (1)
15private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.Web.XmlTransform (9)
XmlElementContext.cs (2)
296private static Regex nameAndArgumentsRegex = null; 297private Regex NameAndArgumentsRegex {
XmlTransforms.cs (7)
301static private RegularExpressions.Regex s_dirRegex = null; 302static private RegularExpressions.Regex s_parentAttribRegex = null; 303static private RegularExpressions.Regex s_tokenFormatRegex = null; 306static internal RegularExpressions.Regex DirRegex 318static internal RegularExpressions.Regex ParentAttributeRegex 330static internal RegularExpressions.Regex TokenFormatRegex 377protected static string SubstituteKownValue(string transformValue, RegularExpressions.Regex patternRegex, string patternPrefix, GetValueCallback getValueDelegate )
Microsoft.Win32.Msi (2)
ActionStartEventArgs.cs (1)
48Match match = Regex.Match(message, @"Action\s(?<actionTime>\d+:\d+:\d+):\s+(?<actionName>.*)\.\s+(?<actionDescription>.*)");
ProgressEventArgs.cs (1)
31Match match = Regex.Match(message, @"(?<field>\d):\s+(?<value>\d+)");
MSBuild (1)
CommandLine\CommandLineParser.cs (1)
389responseFileLine = Regex.Replace(responseFileLine, responseFilePathReplacement,
NativeIntegrations.DockerCompose (16)
ComposeModels.cs (6)
118if (value is not null && !Regex.IsMatch(value, "^(no|always|unless-stopped|on-failure(?::[1-9][0-9]*)?)$", RegexOptions.CultureInvariant)) 131if (value is not null && !Regex.IsMatch(value, "^(always|never|missing|build|daily|weekly|every_[0-9]+[hms])$", RegexOptions.CultureInvariant)) 172if (!Regex.IsMatch(value, "^[a-z0-9][a-z0-9_-]*$", RegexOptions.CultureInvariant)) 279if (!Regex.IsMatch(value, "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$", RegexOptions.CultureInvariant)) 294if (!Regex.IsMatch(value, "^[a-zA-Z0-9][a-zA-Z0-9._/:@-]*$", RegexOptions.CultureInvariant)) 328if (!Regex.IsMatch(duration, @"^(?:[0-9]+(?:\.[0-9]+)?(?:h|ms|us|s|m))+$", RegexOptions.CultureInvariant) ||
DockerComposeEnvironment.cs (4)
92return string.Concat(Regex.Split(value, @"(\$\{[^}]*\})", RegexOptions.CultureInvariant) 224var toolEnvironment = environment.Where(pair => pair.Value is not null && Regex.IsMatch(pair.Key, 234var match = Regex.Match(version, @"^v?(\d+)\.(\d+)(?:\.\d+)?(?:[-+][a-zA-Z0-9.-]+)?$", RegexOptions.CultureInvariant); 297return Regex.Replace(value[..Math.Min(value.Length, 4096)], "[\\x00-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x1b]", "", RegexOptions.CultureInvariant);
DockerComposeGenerator.cs (6)
27"ASPIRE_PARAMETER_" + Regex.Replace(ComposeJson.Text(name).ToUpperInvariant(), "[^A-Z0-9_]", "_", RegexOptions.CultureInvariant); 164!Regex.IsMatch(Text(endpoint, "scheme"), "^[a-z][a-z0-9+.-]*$", RegexOptions.CultureInvariant)) 233var variable = Regex.Replace(resourceName.ToUpperInvariant(), "[^A-Z0-9_]", "_", RegexOptions.CultureInvariant) + "_BINDMOUNT_" + index; 567internal static string ServiceName(string value) => Regex.IsMatch(value, "^[a-z0-9][a-z0-9-]{0,62}$", RegexOptions.CultureInvariant) ? value : $"{Slug(value)}-{Hash(value)}"; 578var slug = Regex.Replace(value.ToLowerInvariant(), "[^a-z0-9-]+", "-", RegexOptions.CultureInvariant).Trim('-'); 603if (!Regex.IsMatch(name, "^[a-zA-Z_][a-zA-Z0-9_]*$", RegexOptions.CultureInvariant))
netstandard (1)
netstandard.cs (1)
2052[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.Regex))]
NuGet.CommandLine.XPlat (2)
Commands\Package\Stage\StagePushCommandRunner.cs (1)
25private static readonly Regex GroupIdRegex = new("^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,62}[A-Za-z0-9])?$");
Commands\PackageSearch\Table.cs (1)
104return Regex.Replace(value ?? string.Empty, @"\r\n|\n\r|\n|\r|\t", " ");
NuGet.Common (7)
PathUtil\PathResolver.cs (4)
26List<Regex> filters = wildcards.Select(WildcardToRegex).ToList(); 73private static Regex WildcardToRegex(string wildcard) 75string pattern = Regex.Escape(wildcard); 133Regex searchRegex = WildcardToRegex(Path.Combine(basePath, searchPath));
PathUtil\PathValidator.cs (3)
44if (!Regex.IsMatch(path.Trim(), @"^[A-Za-z]:\\")) 92return Regex.IsMatch(url, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && Uri.TryCreate(url, UriKind.Absolute, out _); 101return !Regex.IsMatch(path, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && !Path.IsPathRooted(path);
NuGet.Configuration (3)
PackageSource\PackageSourceProvider.cs (1)
375var match = Regex.Match(rawCredentials!.Trim(), @"^Username=(?<user>.*?);\s*Password=(?<pass>.*?)(?:;ValidAuthenticationTypes=(?<authTypes>.*?))?$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
Proxy\WebProxy.cs (2)
20private Regex[]? _regExBypassList; 90return Regex.Escape(pattern)
NuGet.Packaging (4)
Licenses\LicenseExpressionTokenizer.cs (1)
13private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
Licenses\NuGetLicense.cs (1)
89var regex = new Regex("^[a-zA-Z0-9\\.\\-]+$", RegexOptions.CultureInvariant);
PackageCreation\Utility\PackageIdValidator.cs (1)
28private static readonly Regex IdRegex = new Regex(pattern: @"^\w+([.-]\w+)*\z",
Signing\Content\KeyPairFileReader.cs (1)
14private static readonly Regex NamePattern = new Regex("^[a-zA-Z0-9\\.\\-/]+$", RegexOptions.CultureInvariant);
PresentationBuildTasks (1)
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
1308private static partial Regex EscapedXmlEntities { get; }
PresentationFramework (1)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
547private static partial Regex LexiconCultureRegex { get; }
Publishers.AppHost (1)
DistributedApplicationBuilderExtensions.cs (1)
116if (!System.Text.RegularExpressions.Regex.IsMatch(versionInput.Value, @"^\d+\.\d+\.\d+$"))
QuarantineTools.Tests (10)
ActiveIssueTests.cs (6)
66var count = Regex.Matches(updated, "ActiveIssue").Count; 123var count = Regex.Matches(norm, "using Xunit;").Count; 160var count = Regex.Matches(norm, "using Xunit;").Count; 165var activeIssueCount = Regex.Matches(norm, @"\[ActiveIssue\(").Count; 217var countWithSuffix = Regex.Matches(updatedWithSuffix, @"ActiveIssue").Count; 218var countWithoutSuffix = Regex.Matches(updatedWithoutSuffix, @"ActiveIssue").Count;
QuarantineScriptTests.cs (4)
67var count = Regex.Matches(updated, "QuarantinedTest").Count; 193var count = Regex.Matches(norm, "using Aspire.TestUtilities;").Count; 196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline);
RepoTasks (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (5)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
sdk-tasks (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (4)
30private static partial global::System.Text.RegularExpressions.Regex FeatureBandRegex() => global::System.Text.RegularExpressions.Generated.FeatureBandRegex_0.Instance; 61private static partial global::System.Text.RegularExpressions.Regex VersionRegex() => global::System.Text.RegularExpressions.Generated.VersionRegex_1.Instance; 653internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 656internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
WorkloadManifestLayout.cs (2)
249private static partial Regex FeatureBandRegex(); 253private static partial Regex VersionRegex();
ZipFileCreateFromDirectory.cs (3)
68Regex[] regexes = new Regex[ExcludePatterns.Length]; 82foreach (var regex in regexes)
SelectTests (10)
ChangedFileFilter.cs (5)
29private static readonly ChangedFileFilter s_empty = new(Array.Empty<Regex>(), Array.Empty<string>()); 31private readonly IReadOnlyList<Regex> _patternRegexes; 34private ChangedFileFilter(IReadOnlyList<Regex> patternRegexes, IReadOnlyList<string> keepRoutedGlobs) 76foreach (var regex in _patternRegexes) 93private static Regex GlobToRegex(string glob)
Program.cs (2)
306System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")) 466return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")
TriggerMap.cs (3)
165var regex = "^" + Regex.Escape(before) + "([^/]+)" + Regex.Escape(after) + (hasGlobSuffix ? "/.+" : "") + "$"; 167var match = Regex.Match(path, regex);
SuperFileCheck (2)
Program.cs (2)
79var regex = new System.Text.RegularExpressions.Regex(pattern); 90var invalidRegex = new System.Text.RegularExpressions.Regex(invalidFullLinePattern);
System (1)
parent\ref\System.cs (1)
907[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.Regex))]
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
44private Regex? Regex { get; set; }
System.ComponentModel.TypeConverter (9)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex ParameterReplacementRegex => global::System.Text.RegularExpressions.Generated.ParameterReplacementRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the ParameterReplacementRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 134/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 138/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 139internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 142internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\ComponentModel\Design\DesignerVerb.cs (1)
29private static partial Regex ParameterReplacementRegex { get; }
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
11private readonly Regex _regex;
System.Data.Common (20)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (3)
65private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 69private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern
System\Data\Common\DBCommandBuilder.cs (1)
29private readonly Regex _parameterNameParser;
System.Data.Odbc (19)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (3)
65private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 69private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern
System.Data.OleDb (19)
DbConnectionOptions.cs (3)
74private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 76private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 78private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System.DirectoryServices.AccountManagement (2)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (2)
334Regex regex = filter.Extra as Regex;
System.Net.WebProxy (5)
System\Net\WebProxy.cs (5)
26private Regex[]? _regexBypassList; 335Regex[]? regexBypassList = null; 338regexBypassList = new Regex[bypassList.Count]; 369if (_regexBypassList is Regex[] regexBypassList) 384foreach (Regex r in regexBypassList)
System.Private.DataContractSerialization (9)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
174public static partial global::System.Text.RegularExpressions.Regex FullSRSInternalsVisibleRegex => global::System.Text.RegularExpressions.Generated.FullSRSInternalsVisibleRegex_0.Instance; 190/// <summary>Custom <see cref="Regex"/>-derived type for the FullSRSInternalsVisibleRegex method.</summary> 209/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 212/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 408/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 412/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 413internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 416internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Runtime\Serialization\Globals.cs (1)
47public static partial Regex FullSRSInternalsVisibleRegex { get; }
System.Private.Xml (67)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (52)
25private static partial global::System.Text.RegularExpressions.Regex DecodeCharRegex => global::System.Text.RegularExpressions.Generated.DecodeCharRegex_0.Instance; 50private static partial global::System.Text.RegularExpressions.Regex EncodeCharRegex => global::System.Text.RegularExpressions.Generated.EncodeCharRegex_1.Instance; 74private static partial global::System.Text.RegularExpressions.Regex LanguageRegex => global::System.Text.RegularExpressions.Generated.LanguageRegex_2.Instance; 103private static partial global::System.Text.RegularExpressions.Regex Regex1 => global::System.Text.RegularExpressions.Generated.Regex1_3.Instance; 126private static partial global::System.Text.RegularExpressions.Regex Regex2 => global::System.Text.RegularExpressions.Generated.Regex2_4.Instance; 161private static partial global::System.Text.RegularExpressions.Regex EnsureArrayIndexRegex => global::System.Text.RegularExpressions.Generated.EnsureArrayIndexRegex_5.Instance; 183private static partial global::System.Text.RegularExpressions.Regex P0Regex => global::System.Text.RegularExpressions.Generated.P0Regex_6.Instance; 203private static partial global::System.Text.RegularExpressions.Regex UnknownNodeNullAnyTypeRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeNullAnyTypeRegex_7.Instance; 226private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectEmptyRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectEmptyRegex_8.Instance; 246private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectNullRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectNullRegex_9.Instance; 266private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectRegex_10.Instance; 286private static partial global::System.Text.RegularExpressions.Regex ParamsReadRegex => global::System.Text.RegularExpressions.Generated.ParamsReadRegex_11.Instance; 302/// <summary>Custom <see cref="Regex"/>-derived type for the DecodeCharRegex method.</summary> 321/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 324/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 435/// <summary>Custom <see cref="Regex"/>-derived type for the EncodeCharRegex method.</summary> 454/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 457/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 594/// <summary>Custom <see cref="Regex"/>-derived type for the LanguageRegex method.</summary> 613/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 616/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 778/// <summary>Custom <see cref="Regex"/>-derived type for the Regex1 method.</summary> 799/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 802/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1068/// <summary>Custom <see cref="Regex"/>-derived type for the Regex2 method.</summary> 1089/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1092/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1247/// <summary>Custom <see cref="Regex"/>-derived type for the EnsureArrayIndexRegex method.</summary> 1268/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1271/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1592/// <summary>Custom <see cref="Regex"/>-derived type for the P0Regex method.</summary> 1613/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1616/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1797/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeNullAnyTypeRegex method.</summary> 1818/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1821/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1935/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectEmptyRegex method.</summary> 1956/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1959/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2108/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectNullRegex method.</summary> 2129/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2132/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2252/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectRegex method.</summary> 2273/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2276/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2396/// <summary>Custom <see cref="Regex"/>-derived type for the ParamsReadRegex method.</summary> 2417/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2420/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2540/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2544/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2545internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2548internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Xml\Schema\FacetChecker.cs (3)
874Regex regex = (Regex)restriction.Patterns[i]!; 1345private static partial Regex LanguageRegex { get; }
System\Xml\Serialization\SourceInfo.cs (2)
19private static partial Regex Regex1 { get; } 23private static partial Regex Regex2 { get; }
System\Xml\Serialization\XmlSerializationReaderILGen.cs (7)
2799private static partial Regex EnsureArrayIndexRegex { get; } 2802private static partial Regex P0Regex { get; } 3707private static partial Regex UnknownNodeNullAnyTypeRegex { get; } 3710private static partial Regex UnknownNodeObjectEmptyRegex { get; } 3713private static partial Regex UnknownNodeObjectNullRegex { get; } 3716private static partial Regex UnknownNodeObjectRegex { get; } 3719private static partial Regex ParamsReadRegex { get; }
System\Xml\XmlConvert.cs (3)
89Regex.ValueMatchEnumerator en = DecodeCharRegex.EnumerateMatches(name.AsSpan(underscorePos)); 284private static partial Regex DecodeCharRegex { get; } 287private static partial Regex EncodeCharRegex { get; }
System.Security.Permissions (2)
System\Net\WebPermission.cs (2)
18public WebPermission(NetworkAccess access, Regex uriRegex) { } 23public void AddPermission(NetworkAccess access, Regex uriRegex) { }
System.Text.Json (5)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (4)
23public static partial global::System.Text.RegularExpressions.Regex IntegerRegex => global::System.Text.RegularExpressions.Generated.IntegerRegex_0.Instance; 39/// <summary>Custom <see cref="Regex"/>-derived type for the IntegerRegex method.</summary> 57/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 60/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
System\Text\Json\JsonHelpers.cs (1)
315public static partial Regex IntegerRegex { get; }
System.Text.RegularExpressions (150)
System\Text\RegularExpressions\Capture.cs (1)
50/// If a call to the <see cref="Regex.Match(string)"/> or <see cref="Match.NextMatch"/> method fails to
System\Text\RegularExpressions\GeneratedRegexAttribute.cs (3)
15/// partial, parameterless, non-generic methods or get-only properties that are typed to return <see cref="Regex"/>. 18/// When the <see cref="Regex"/> supports case-insensitive matches (either by passing 25/// This differs from the rest of the <see cref="Regex"/> engines, which perform this transformation at run time,
System\Text\RegularExpressions\Match.cs (12)
13/// <see cref="Match"/> class is returned by the <see cref="Regex.Match(string)"/> method and 17/// objects is returned by the <see cref="Regex.Matches(string)"/> method. 20/// If the <see cref="Regex.Matches(string)"/> method fails to match a regular expression pattern in 25/// If the <see cref="Regex.Match(string)"/> method fails to match the regular expression pattern, it 47internal readonly Regex? _regex; 58internal Match(Regex? regex, int capcount, string? text, int textLength) : 142/// This method is similar to calling <see cref="Regex.Match(string, int)"/> again and passing 163Regex? r = _regex; 183/// Whereas the <see cref="Regex.Replace(string, string)"/> method replaces all matches in an 203Regex? regex = _regex ?? throw new NotSupportedException(SR.NoResultOnFailed); 209return Regex.SegmentsToStringAndDispose(ref segments); 466internal MatchSparse(Regex regex, Hashtable caps, int capcount, string? text, int textLength) :
System\Text\RegularExpressions\MatchCollection.cs (5)
13/// constructor. The <see cref="Regex.Matches(string)" /> method returns a 32/// with all matches resulting from a particular call to the <see cref="Regex.Matches(string)" /> 43/// <see cref="Regex.Match(string)" /> method repeatedly and adding each match to the collection. 59private readonly Regex _regex; 66internal MatchCollection(Regex regex, string input, int startat)
System\Text\RegularExpressions\Regex.Cache.cs (17)
22/// The <see cref="Regex"/> class maintains an internal cache of regular expression instances used in 23/// static <see cref="Regex"/> method calls, such as <see cref="Regex.Match(string, string)"/> or 24/// <see cref="Regex.Replace(string, string, string)"/>. If the value specified in a set operation is 131public static Regex GetOrAdd(string pattern) 137Regex.ValidatePattern(pattern); 140Key key = new Key(pattern, culture.ToString(), RegexOptions.None, Regex.s_defaultMatchTimeout); 142Regex? regex = Get(key); 152public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 154Regex.ValidatePattern(pattern); 155Regex.ValidateOptions(options); 156Regex.ValidateMatchTimeout(matchTimeout); 161Regex? regex = Get(key); 171private static Regex? Get(Key key) 215private static void Add(Key key, Regex regex) 331private sealed class Node(Key key, Regex regex) 336public readonly Regex Regex = regex;
System\Text\RegularExpressions\Regex.cs (14)
67/// <summary>Initializes a new instance of the <see cref="Regex" /> class.</summary> 82/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression. 93/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 109/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 232/// <summary>Initializes a new instance of the <see cref="Regex" /> class by using serialized data.</summary> 235/// <exception cref="PlatformNotSupportedException">Serialization of <see cref="Regex" /> objects is not supported.</exception> 287/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly. 297/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly with the specified attributes. 307/// Compiles one or more specified <see cref="Regex" /> objects and a specified resource file 405/// <summary>Gets the options that were passed into the <see cref="Regex" /> constructor.</summary> 408/// to the <see cref="Regex" /> constructor. 425/// <summary>Returns the regular expression pattern that was passed into the <see cref="Regex" /> constructor.</summary> 427/// The pattern that was passed into the <see cref="Regex" /> constructor. 549/// Used by a <see cref="Regex" /> object generated by the
System\Text\RegularExpressions\Regex.EnumerateMatches.cs (5)
103/// The enumerator has no public constructor. The <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/> 104/// method returns a <see cref="Regex.ValueMatchEnumerator"/> object. The enumerator will lazily iterate 117private readonly Regex _regex; 126/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 129internal ValueMatchEnumerator(Regex regex, ReadOnlySpan<char> input, int startAt)
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (3)
181private readonly Regex _regex; 192/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 197internal ValueSplitEnumerator(Regex regex, ReadOnlySpan<char> input, int count, int startAt, bool rtl)
System\Text\RegularExpressions\Regex.Match.cs (28)
32/// <see cref="Regex"/> object with the specified pattern and calling the <see cref="IsMatch(string)"/> 81/// <see cref="Regex"/> object with the specified pattern and options and calling the 115/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 140/// constructing a <see cref="Regex"/> object with the specified pattern and options and calling the 163/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 180/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 201/// established for the application domain in which the <see cref="Regex"/> object is created. If no 202/// time-out is defined in the <see cref="Regex"/> constructor call or in the application domain's 203/// properties, or if the time-out value is <see cref="Regex.InfiniteMatchTimeout"/>, no exception 218/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 254/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 266/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 292/// <see cref="Regex"/> object with the specified pattern and calling the instance 329/// <see cref="Regex"/> object with the <see cref="Regex(string, RegexOptions)"/> constructor and calling 350/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 366/// constructing a <see cref="Regex"/> object with the 390/// the <see cref="Regex"/> constructor. 417/// established for the application domain in which the <see cref="Regex"/> object is created. If no 418/// time-out is defined in the <see cref="Regex"/> constructor call or in the application domain's 419/// properties, or if the time-out value is <see cref="Regex.InfiniteMatchTimeout"/>, no exception 590/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 635/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 662/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 684/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 731/// <see cref="Regex.MatchTimeout"/> property is not <see cref="Regex.InfiniteMatchTimeout"/> and a 780/// <see cref="Regex.MatchTimeout"/> property is not <see cref="Regex.InfiniteMatchTimeout"/> and a
System\Text\RegularExpressions\Regex.Replace.cs (16)
10/// <see cref="Regex.Replace(string, MatchEvaluator)"/> method operation. 13/// match during a <see cref="Regex.Replace(string, MatchEvaluator)"/> method operation.</param> 19/// <see cref="Regex.Replace(string, MatchEvaluator)"/>. For each matched string, the 20/// <see cref="Regex.Replace(string, MatchEvaluator)"/> method calls the 23/// the <see cref="Regex.Replace(string, MatchEvaluator)"/> method substitutes for the matched string. 52/// <see cref="Regex"/> object with the specified regular expression pattern and calling the instance method 97/// constructing a <see cref="Regex"/> object with the specified regular expression pattern and calling the 131/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to 152/// to constructing a <see cref="Regex"/> object with the specified regular expression pattern and calling 344/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 390/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 419/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to 445/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 492/// The method is equivalent to calling the <see cref="Regex.Matches(string)"/> method and passing each 537/// The method is equivalent to calling the <see cref="Regex.Matches(string)"/> method and passing the 610private static string Replace(MatchEvaluator evaluator, Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Split.cs (17)
26/// <see cref="Regex"/> object with the specified regular expression pattern and calling the 30/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 31/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 67/// constructing a <see cref="Regex"/> object with the specified regular expression pattern 71/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 72/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 102/// A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate that the 120/// equivalent to constructing a <see cref="Regex"/> object with the specified regular 124/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 125/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 152/// regular expression pattern specified in the <see cref="Regex"/> constructor. 162/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 163/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 193/// at the positions defined by a regular expression specified in the <see cref="Regex"/> 205/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to 232/// at the positions defined by a regular expression specified in the <see cref="Regex"/> 278private static string[] Split(Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Timeout.cs (5)
19/// Setting this to a valid TimeSpan will cause that TimeSpan to be used as the timeout for <see cref="Regex"/> instances created 53/// The default timeout value to use if one isn't explicitly specified when creating the <see cref="Regex"/> 77/// <see cref="Regex"/> instance to execute a single matching operation before the operation times out. 86/// This property is read-only. You can set its value explicitly for an individual <see cref="Regex"/> 88/// set its value for all <see cref="Regex"/> matching operations in an application domain by calling
System\Text\RegularExpressions\RegexCompilationInfo.cs (3)
37: this(pattern, options, name, fullnamespace, ispublic, Regex.s_defaultMatchTimeout) 80/// <see cref="RegexMatchTimeoutException"/> is thrown, or <see cref="Regex.InfiniteMatchTimeout"/> if time-outs are disabled. 87Regex.ValidateMatchTimeout(value);
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (2)
170/// <see cref="Regex.Match(string, int)"/>. 199/// <see cref="Regex"/> constructor or static method. It does not reflect the exact interval
System\Text\RegularExpressions\RegexReplacement.cs (4)
194public string Replace(Regex regex, string input, int count, int startat) 226private static unsafe string ReplaceSimpleText(Regex regex, string input, string replacement, int count, int startat) 296private string ReplaceNonSimpleText(Regex regex, string input, int count, int startat) 343return Regex.SegmentsToStringAndDispose(ref state.segments);
System\Text\RegularExpressions\RegexRunner.cs (10)
102protected internal Regex? runregex; 115/// <summary>Used by a <see cref="Regex"/> object to scan the input <paramref name="text"/> looking for the next match.</summary> 119/// <see cref="ReadOnlySpan{T}"/>-based <see cref="Regex"/> methods are not supported from <see cref="Regex"/>-derived types 163/// <summary>Used by a <see cref="Regex"/> object to scan the input <paramref name="text"/>.</summary> 165protected Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick) => 173protected internal Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, TimeSpan timeout) 233private Match InternalScan(Regex regex, int textbeg, int textend) 278internal void InitializeForScan(Regex regex, ReadOnlySpan<char> text, int textstart, RegexRunnerMode mode) 345if (Regex.InfiniteMatchTimeout != timeout)
System\Text\RegularExpressions\RegexRunnerFactory.cs (2)
8/// <summary>Creates a <see cref="RegexRunner"/> for a <see cref="Regex"/>.</summary> 15/// <summary>Creates a <see cref="RegexRunner"/> instance for the <see cref="Regex"/>.</summary>
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (1)
175_checkTimeout = Regex.InfiniteMatchTimeout != matchTimeout;
System\Text\RegularExpressions\ValueMatch.cs (2)
10/// <see cref="Regex.ValueMatchEnumerator.Current"/> method when iterating over the results from 11/// calling <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/>.
System.Windows.Forms (10)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
18private static partial global::System.Text.RegularExpressions.Regex ContiguousNonWhitespace() => global::System.Text.RegularExpressions.Generated.ContiguousNonWhitespace_0.Instance; 34/// <summary>Custom <see cref="Regex"/>-derived type for the ContiguousNonWhitespace method.</summary> 53/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 56/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 140/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 144/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 145internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 148internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (2)
189Regex r = ContiguousNonWhitespace(); 208private static partial Regex ContiguousNonWhitespace();
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\ApplicationConfig.FontDescriptor.cs (1)
29string name = Regex.Replace(Name, @"[^\w\d ]", string.Empty);
System.Windows.Forms.Design (11)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (9)
20private static partial global::System.Text.RegularExpressions.Regex SanitizeNameRegex() => global::System.Text.RegularExpressions.Generated.SanitizeNameRegex_0.Instance; 39private static partial global::System.Text.RegularExpressions.Regex ParenthesisRegex() => global::System.Text.RegularExpressions.Generated.SanitizeNameRegex_0.Instance; 55/// <summary>Custom <see cref="Regex"/>-derived type for the SanitizeNameRegex method.</summary> 74/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 77/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 153/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 157/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 158internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 161internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\ComponentModel\Design\DesignerActionItem.cs (1)
27private static partial Regex SanitizeNameRegex();
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2229private static partial Regex ParenthesisRegex();
TypeScriptApiCompat (1)
ApiCompatSuppression.cs (1)
132private static partial Regex SuppressionLineRegex();
vstest.console (3)
Internal\MSBuildLogger.cs (3)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 420private static Regex? s_regex; 433string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine);
vstest.console.arm64 (3)
parent\vstest.console\Internal\MSBuildLogger.cs (3)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 420private static Regex? s_regex; 433string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine);