96 types derived from Regex
aspire (18)
RegexGenerator.g.cs (18)
425file sealed class GetProjectNameRegex_0 : Regex 557file sealed class SdkDirectiveRegex_1 : Regex 724file sealed class HeaderLevel6Regex_2 : Regex 950file sealed class HeaderLevel5Regex_3 : Regex 1176file sealed class HeaderLevel4Regex_4 : Regex 1402file sealed class HeaderLevel3Regex_5 : Regex 1628file sealed class HeaderLevel2Regex_6 : Regex 1854file sealed class HeaderLevel1Regex_7 : Regex 2080file sealed class BoldDoubleAsterisksRegex_8 : Regex 2221file sealed class BoldDoubleUnderscoresRegex_9 : Regex 2362file sealed class ItalicSingleAsteriskRegex_10 : Regex 2550file sealed class ItalicSingleUnderscoreRegex_11 : Regex 2738file sealed class StrikethroughRegex_12 : Regex 2879file sealed class CodeBlockRegex_13 : Regex 3086file sealed class InlineCodeRegex_14 : Regex 3227file sealed class ImageRegex_15 : Regex 3397file sealed class LinkRegex_16 : Regex 3573file sealed class RemoveSpectreFormattingRegex_17 : Regex
Aspire.Azure.Storage.Blobs (1)
RegexGenerator.g.cs (1)
41file sealed class ResourceGroupValidCharacters_0 : Regex
Aspire.Azure.Storage.Queues (1)
RegexGenerator.g.cs (1)
41file sealed class ResourceGroupValidCharacters_0 : Regex
Aspire.Confluent.Kafka.Tests (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Dashboard (7)
RegexGenerator.g.cs (7)
317file sealed class GenerateUrlRegEx_0 : Regex 762file sealed class HostPortRegex_1 : Regex 1020file sealed class JdbcUrlRegex_2 : Regex 1378file sealed class HostRegex_3 : Regex 1548file sealed class MatchSecondsInTimeFormatPattern_4 : Regex 1771file sealed class GenerateRfc3339RegEx_5 : Regex 2234file sealed class NonAlphanumericRegex_6 : Regex
Aspire.EndToEnd.Tests (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Hosting (5)
RegexGenerator.g.cs (5)
244file sealed class ApplicationNameRegex_0 : Regex 417file sealed class VersionRegex_1 : Regex 555file sealed class ImageNameRegex_2 : Regex 1514file sealed class GenerateRfc3339RegEx_3 : Regex 1978file sealed class NonAlphanumericRegex_4 : Regex
Aspire.Hosting.Azure (1)
RegexGenerator.g.cs (1)
41file sealed class ResourceGroupValidCharacters_0 : Regex
Aspire.Hosting.Azure.KeyVault (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Hosting.DevTunnels (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Hosting.Python (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Hosting.SqlServer (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
Aspire.Templates.Tests (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
BuildActionTelemetryTable (1)
RegexGenerator.g.cs (1)
61file sealed class ChangeOfCaseRegex_0 : Regex
ConfigurationSchemaGenerator (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
ConfigurationSchemaGenerator.Tests (1)
RegexGenerator.g.cs (1)
46file sealed class BlankLinesInDocComment_0 : Regex
dotnet-dev-certs (3)
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)
RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.Components (1)
RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
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)
RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.Server.Kestrel.Core (1)
RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.CodeAnalysis (2)
RegexGenerator.g.cs (2)
86file sealed class GetSectionMatcherRegex_0 : Regex 521file sealed class GetPropertyMatcherRegex_1 : Regex
Microsoft.ML.Tokenizers (6)
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
System.ComponentModel.TypeConverter (2)
RegexGenerator.g.cs (2)
59file sealed class DebuggerDisplayAttributeValueRegex_0 : Regex 198file sealed class ContainsNqSuffixRegex_1 : Regex
System.Data.Common (2)
RegexGenerator.g.cs (2)
59file sealed class DebuggerDisplayAttributeValueRegex_0 : Regex 198file sealed class ContainsNqSuffixRegex_1 : Regex
System.Data.Odbc (5)
RegexGenerator.g.cs (5)
221file sealed class CreateConnectionStringRegex_0 : Regex 1461file sealed class CreateConnectionStringRegexOdbc_1 : Regex 2447file sealed class CreateConnectionStringValidKeyRegex_2 : Regex 2625file sealed class CreateConnectionStringQuoteValueRegex_3 : Regex 2726file sealed class CreateConnectionStringQuoteOdbcValueRegex_4 : Regex
System.Private.DataContractSerialization (2)
RegexGenerator.g.cs (2)
59file sealed class DebuggerDisplayAttributeValueRegex_0 : Regex 198file sealed class ContainsNqSuffixRegex_1 : Regex
System.Private.Xml (2)
RegexGenerator.g.cs (2)
59file sealed class DebuggerDisplayAttributeValueRegex_0 : Regex 198file sealed class ContainsNqSuffixRegex_1 : Regex
System.Text.Json (2)
RegexGenerator.g.cs (2)
59file sealed class DebuggerDisplayAttributeValueRegex_0 : Regex 198file sealed class ContainsNqSuffixRegex_1 : Regex
System.Windows.Forms (1)
RegexGenerator.g.cs (1)
37file sealed class ContiguousNonWhitespace_0 : Regex
System.Windows.Forms.Design (1)
RegexGenerator.g.cs (1)
37file sealed class ContiguousNonWhitespace_0 : Regex
System.Windows.Forms.Tests (1)
RegexGenerator.g.cs (1)
39file sealed class PlaceholdersPattern_0 : Regex
Templates.Blazor.Tests (3)
RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Templates.Blazor.WebAssembly.Auth.Tests (3)
RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Templates.Blazor.WebAssembly.Tests (3)
RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Templates.Mvc.Tests (3)
RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Templates.Tests (3)
RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
527 instantiations of Regex
AnalyzerRunner (1)
Options.cs (1)
162var expression = new Regex(arg.Substring("/editperf:".Length), RegexOptions.Compiled | RegexOptions.IgnoreCase);
aspire (3)
Utils\ConsoleActivityLogger.cs (1)
391private static readonly Regex s_urlRegex = new(
Utils\MarkdownToSpectreConverter.cs (2)
159var regex = new Regex(@"^>\s*(.*)$"); 205var spectreRegex = new Regex(spectrePattern);
Aspire.Dashboard (2)
Components\Layout\MobileNavMenu.razor.cs (2)
45LinkMatchRegex: new Regex($"^{DashboardUrls.ResourcesUrl()}(\\?.*)?$") 111return new Regex($"^({pageRelativeBasePath}|{pageRelativeBasePath}/.+)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
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 (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Microsoft.Data.SqlClient (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
47var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Aspire.Templates.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
BuildBoss (1)
CompilerNuGetCheckerUtil.cs (1)
100var regex = new Regex(@"^(.*?)\.\d.*\.nupkg$");
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet (34)
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
Commands\Test\VSTest\TestCommand.cs (17)
645new("^xterm"), // xterm, PuTTY, Mintty 646new("^rxvt"), // RXVT 647new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 648new("^screen"), // GNU screen, tmux 649new("tmux"), // tmux 650new("^vt100"), // DEC VT series 651new("^vt102"), // DEC VT series 652new("^vt220"), // DEC VT series 653new("^vt320"), // DEC VT series 654new("ansi"), // ANSI 655new("scoansi"), // SCO ANSI 656new("cygwin"), // Cygwin, MinGW 657new("linux"), // Linux console 658new("konsole"), // Konsole 659new("bvterm"), // Bitvise SSH Client 660new("^st-256color"), // Suckless Simple Terminal, st 661new("alacritty"), // Alacritty
dotnet-format.UnitTests (4)
CodeFormatterTests.cs (4)
47private Regex FindFormattingLogLine => new Regex(@"((.*)\(\d+,\d+\): (.*))\r|((.*)\(\d+,\d+\): (.*))"); 181var match = new Regex(pattern, RegexOptions.Multiline).Match(log); 248var match = new Regex(pattern, RegexOptions.Multiline).Match(log); 338var match = new Regex(pattern, RegexOptions.Multiline).Match(log);
dotnet-svcutil-lib (9)
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.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})_");
dotnet-watch.Tests (6)
HotReload\ApplyDeltaTests.cs (5)
258App.AssertOutputContains(new Regex(@"dotnet watch ⌚ Exclusion glob: 'AppData/[*][*]/[*][.][*];bin[/\\]+Debug[/\\]+[*][*];obj[/\\]+Debug[/\\]+[*][*];bin[/\\]+[*][*];obj[/\\]+[*][*]")); 742await App.WaitUntilOutputContains(new Regex(@"dotnet watch 🕵️ \[.*\] Windows Ctrl\+C handling enabled.")); 1181App.AssertOutputContains(new Regex(@"dotnet watch ⌚ \[WatchAspire.ApiService \(net.*\)\] Process id [0-9]+ ran for [0-9]+ms and exited with exit code 0")); 1204await App.WaitUntilOutputContains(new Regex(@"dotnet watch ⌚ \[WatchAspire.ApiService \(net.*\)\] Process id [0-9]+ ran for [0-9]+ms and exited with exit code 0")); 1205await App.WaitUntilOutputContains(new Regex(@"dotnet watch ⌚ \[WatchAspire.AppHost \(net.*\)\] Process id [0-9]+ ran for [0-9]+ms and exited with exit code 0"));
TestUtilities\WatchableApp.cs (1)
45=> new Regex(Regex.Replace(Regex.Escape((projectDisplay != null ? $"[{projectDisplay}] " : "") + descriptor.Format), @"\\\{[0-9]+\}", ".*"));
IIS.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
319var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 354var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
70var expectedRegex = new Regex(EventLogHelpers.ShutdownMessage(result), RegexOptions.Singleline);
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
IISExpress.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
319var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 354var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
illink (1)
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
InteropTests (1)
Helpers\WebsiteProcess.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: .*:(?<port>\d*)$");
Metrics (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Metrics.Legacy (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
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.App.Analyzers.Test (1)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
49private static readonly Regex s_namedSpanStartRegex = new Regex(@"\{\| ([-_.A-Za-z0-9\+]+) \:",
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
RazorComponentResultTest.cs (3)
403private static readonly Regex TemplateElementComponentIdRegex = new Regex("blazor-component-id=\"\\d+\""); 404private static readonly Regex OpenBoundaryMarkerRegex = new Regex("<!--bl:\\d+-->"); 405private static readonly Regex CloseBoundaryMarkerRegex = new Regex("<!--/bl:\\d+-->");
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)
src\Grpc\JsonTranscoding\src\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.Grpc.Swagger (2)
src\Grpc\JsonTranscoding\src\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.InternalTesting.Tests (4)
AssemblyTestLogTests.cs (3)
362private static readonly Regex TimestampRegex = new(@"\d+-\d+-\d+T\d+:\d+:\d+"); 363private static readonly Regex TimestampOffsetRegex = new(@"\d+\.\d+s"); 364private static readonly Regex DurationRegex = new(@"[^ ]+s$");
XunitLoggerProviderTest.cs (1)
82private static readonly Regex TimestampRegex = new Regex(@"\d+-\d+-\d+T\d+:\d+:\d+");
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.Rewrite.Tests (3)
IISUrlRewrite\FileParserTests.cs (3)
57condList.Add(new Condition(new InputParser().ParseInputString("{HTTPS}"), new RegexMatch(new Regex("^OFF$"), false))); 97condList.Add(new Condition(new InputParser().ParseInputString("{HTTPS}"), new RegexMatch(new Regex("^OFF$"), false))); 190new RegexMatch(new Regex("^OFF$"), negate),
Microsoft.AspNetCore.Routing (1)
Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Routing.Tests (3)
Constraints\RegexRouteConstraintTests.cs (3)
49var constraint = new RegexRouteConstraint(new Regex("^abc$")); 68var constraint = new RegexRouteConstraint(new Regex("^abc$")); 87var constraint = new RegexRouteConstraint(new Regex("^abc$"));
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISExpressDeployer.cs (1)
27private static readonly Regex UrlDetectorRegex = new Regex(@"^\s*Successfully registered URL ""(?<url>[^""]+)"" for site.*$");
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 (26)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
128manifest.ResolvableSdkRegex = new Regex(pattern, regexOptions, TimeSpan.FromMilliseconds(SdkResolverPatternRegexTimeoutMsc));
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
33private static Regex SectionMatcherRegex { get; } = new Regex(s_sectionMatcherPattern, RegexOptions.Compiled); 35private static Regex PropertyMatcherRegex { get; } = new Regex(s_propertyMatcherPattern, RegexOptions.Compiled);
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
CanonicalError.cs (8)
160new Regex(OriginCategoryCodeTextExpressionPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 164new Regex(OriginCategoryCodeTextExpression2Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 168new Regex(FilenameLocationFromOriginPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 172new Regex(LineFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 176new Regex(LineLineFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 180new Regex(LineColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 184new Regex(LineColColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 188new Regex(LineColLineColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Construction\ProjectRootElement.cs (1)
70private static Regex XmlDeclarationRegex => s_xmlDeclarationRegex ??= new Regex(XmlDeclarationPattern);
Construction\Solution\SolutionFile.cs (2)
72private static Regex CrackProjectLineRegex => s_crackProjectLineRegex ??= new Regex(CrackProjectLinePattern, RegexOptions.Compiled); 73private static Regex CrackPropertyLineRegex => s_crackPropertyLineRegex ??= new Regex(CrackPropertyLinePattern, RegexOptions.Compiled);
Definition\ToolsetReader.cs (1)
193var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander.cs (2)
3455new Regex(ItemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled); 3492new Regex(NonTransformItemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
Evaluation\IntrinsicFunctions.cs (1)
50private static Regex RegistrySdkRegex => s_registrySdkRegex ??= new Regex(RegistrySdkSpecification, RegexOptions.IgnoreCase);
FileMatcher.cs (2)
1508regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2171matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Globbing\MSBuildGlob.cs (1)
217Regex newRegex = new Regex(matchFileExpression, regexOptions);
ProjectWriter.cs (2)
58new Regex(itemVectorTransformSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled); 62new Regex(itemVectorTransformRawSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled);
Utilities\EngineFileUtilities.cs (1)
577Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\Utilities.cs (1)
305private static Regex XmlnsPattern { get; } = new Regex("xmlns=\"[^\"]*\"\\s*");
Microsoft.Build.BuildCheck.UnitTests (1)
EndToEndTests.cs (1)
218Regex regex = new Regex(@"(\d+) Warning\(s\)");
Microsoft.Build.CommandLine.UnitTests (1)
MSBuildServer_Tests.cs (1)
352Regex regex = new(@$"{toFind}(\d+)");
Microsoft.Build.Engine.UnitTests (10)
BackEnd\SdkResolverService_Tests.cs (2)
784var man = new SdkResolverManifest(DisplayName: "TestResolversManifest", Path: null, ResolvableSdkRegex: new Regex("abc")); 866new Regex(pair.ResolvableSdkPattern, RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(500)));
Evaluation\ExpressionShredder_Tests.cs (4)
1250private static readonly Regex s_itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1255new Regex(@"^\s*(;\s*)*(" + 1271private static readonly Regex s_itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1280new Regex(@"((?<=" + itemVectorWithTransformLHS + @")" + itemMetadataSpecification + @"(?!" + itemVectorWithTransformRHS + @")) |
FileUtilitiesRegex_Tests.cs (4)
22internal static readonly Regex DrivePattern = new Regex(@"^[A-Za-z]:$", RegexOptions.Compiled); 25internal static readonly Regex StartWithDrivePattern = new Regex(@"^[A-Za-z]:", RegexOptions.Compiled); 33internal static readonly Regex StartsWithUncPattern = new Regex(s_baseUncPattern, RegexOptions.Compiled); 37new Regex(
Microsoft.Build.Framework (17)
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
Microsoft.Build.Tasks.CodeAnalysis (7)
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.CodeAnalysis.Sdk (7)
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 (3)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
27() => new Regex(
FileMatcher.cs (2)
1508regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2171matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Microsoft.Build.Tasks.UnitTests (1)
XslTransformation_Tests.cs (1)
52private readonly Regex _surroundMatch = new Regex("surround", RegexOptions.Multiline | RegexOptions.Compiled);
Microsoft.Build.Utilities.Core (12)
CanonicalError.cs (8)
160new Regex(OriginCategoryCodeTextExpressionPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 164new Regex(OriginCategoryCodeTextExpression2Pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 168new Regex(FilenameLocationFromOriginPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 172new Regex(LineFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 176new Regex(LineLineFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 180new Regex(LineColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 184new Regex(LineColColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); 188new Regex(LineColLineColFromLocationPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
CommandLineBuilder.cs (2)
158new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant); 164new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
FileMatcher.cs (2)
1508regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2171matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Microsoft.Build.Utilities.UnitTests (1)
ToolTask_Tests.cs (1)
275Regex regex = new Regex(pattern);
Microsoft.Cci.Extensions (1)
Extensions\CSharp\CSharpCciExtensions.cs (1)
650s_isKeywordRegex = new Regex("^(abstract|as|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|foreach|for|get|goto|if|implicit|interface|internal|in|is|lock|namespace|new|operator|out|override|params|partial|private|protected|public|readonly|ref|return|sealed|set|sizeof|stackalloc|static|struct|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield|bool|byte|char|decimal|double|fixed|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void)$", RegexOptions.Compiled);
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
119var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled));
SourceGeneration\AdditionalSourcesCollection.cs (1)
27private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.BannedApiAnalyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (8)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
139regex = new Regex(token.ValueText, options);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTrackingDiagnosticAnalyzer.cs (1)
20new Regex(@"Using|Extern|Parameter|Constraint|Specifier|Initializer|Global|Method|Destructor|MemberBindingExpression|ElementBindingExpression|ArrowExpressionClause|NameOfExpression");
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.EditorFeatures (4)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (3)
136private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 152private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 198if ((relativePath.IsEmpty() || new Regex(fileName).IsMatch(relativePath)) &&
LanguageServer\RazorInProcLanguageClient.cs (1)
84var regex = new Regex(regexExpression, RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Semantics\SpeculationAnalyzerTestsBase.cs (1)
19protected readonly Regex UnderTestRegex = new(@"\[\|(?<content>.*?)\|\]");
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
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})\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
208new(
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
38private protected static readonly Regex s_timePropertiesRegex = new("[|](EmitDifferenceMilliseconds|TotalAnalysisMilliseconds)=[0-9]+");
EditAndContinue\SourceMarkers.cs (3)
19private static readonly Regex s_tags = new( 22public static readonly Regex ExceptionRegionPattern = new( 30private static readonly Regex s_trackingStatementPattern = new(
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
44private static readonly Regex s_markdownEscapeRegex = new(@"([\\`\*_\{\}\[\]\(\)#+\-\.!<>])", RegexOptions.Compiled);
Protocol\Internal\Converters\RegexConverter.cs (1)
20return new Regex(reader.GetString(), RegexOptions.Compiled | RegexOptions.ECMAScript, matchTimeout: TimeSpan.FromMilliseconds(1000));
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (1)
339var regex = new Regex(s_clientSideSectionPattern);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.PublicApiAnalyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.ResxSourceGenerator (8)
AbstractResxGenerator.cs (2)
871private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 872private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.Test.Utilities (6)
CompilationVerifier.cs (2)
277private static readonly Regex s_headerCommentsRegex = new("""^\s*// Header size: [0-9]+\s*$""", RegexOptions.Multiline); 278private static readonly Regex s_codeSizeCommentsRegex = new("""^\s*// Code size(:) [0-9]+\s*""", RegexOptions.Multiline);
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
67new Regex(@"None|Trivia|Token|Keyword|List|Xml|Cref|Compilation|Namespace|Class|Struct|Enum|Interface|Delegate|Field|Property|Indexer|Event|Operator|Constructor|Access|Incomplete|Attribute|Filter|InterpolatedString");
MarkedSource\MarkupTestFile.cs (1)
49private static readonly Regex s_namedSpanStartRegex = new Regex(@"\{\| ([-_.A-Za-z0-9\+]+) \:",
MarkedSource\SourceWithMarkedNodes.cs (2)
85private static readonly Regex s_tags = new Regex( 89private static readonly Regex s_markerPattern = new Regex(
Microsoft.CodeAnalysis.Workspaces (8)
Rename\RenameUtilities.cs (1)
292return new Regex(matchString, RegexOptions.CultureInvariant);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
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.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.Data.Analysis.Tests (3)
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)
RegexStringTransformer.cs (1)
34_patterns[i] = (new Regex(rawPatterns[i].CaptureGroupPattern, RegexOptions.Compiled), rawPatterns[i].ReplacementString);
Microsoft.DotNet.ApiCompat.Tests (1)
RegexStringTransformer.cs (1)
34_patterns[i] = (new Regex(rawPatterns[i].CaptureGroupPattern, RegexOptions.Compiled), rawPatterns[i].ReplacementString);
Microsoft.DotNet.ApiCompat.Tool (1)
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)
489private static readonly Regex _namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 490private static readonly Regex _numberParameterMatcher = new Regex(@"\{(\d+)\}", RegexOptions.Compiled);
Microsoft.DotNet.Build.Tasks.Feed (3)
src\BuildModelFactory.cs (1)
78private readonly Regex LegacyRepositoryUriPattern = new Regex(
src\common\AzureConnectionStringBuildTask.cs (1)
39Regex storageConnectionStringRegex = new Regex("AccountName=(?<name>.+?);AccountKey=(?<key>.+?);");
src\PublishArtifactsInManifestBase.cs (1)
194private static Regex FourPartVersionRegex = new Regex(FourPartVersionPattern);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\GenerateCurrentVersion.cs (1)
97Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Git.IssueManager (3)
Clients\AzureDevOpsClient.cs (2)
17private static readonly Regex RepositoryUriPattern = new Regex( 20private static readonly Regex LegacyRepositoryUriPattern = new Regex(
Clients\GitHubClient.cs (1)
82Regex repositoryUriPattern = new Regex(@"^/(?<owner>[^/]+)/(?<repo>[^/]+)/?$");
Microsoft.DotNet.Helix.JobSender (3)
JobDefinition.cs (3)
207Regex illegalCharacters = new Regex("[^a-z0-9-]"); 208Regex multipleDashes = new Regex("-{2,}"); 280Match queueInfoSplit = new Regex(@"\((.+?)\)(.*)").Match(queueInfo);
Microsoft.DotNet.Helix.Sdk (1)
ProvisioningProfileProvider.cs (1)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
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)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.VersionTools.Tasks (3)
src\BaseDependenciesTask.cs (3)
83new Regex($@"<{elementName}>(?<{contentGroupName}>.*)</{elementName}>"); 86new Regex($@"""{msbuildSdkName}""\s*:\s*""(?<{contentGroupName}>.*)"""); 319updater.Regex = new Regex(manualRegex);
Microsoft.DotNet.XUnitAssert.Tests (7)
StringAssertsTests.cs (7)
309 Assert.Throws<MatchesException>(() => Assert.Matches(new Regex(@"\w+"), null)); 315 Assert.Matches(new Regex(@"\w+"), "Hello"); 321 Assert.Matches(new Regex(@"[a-z]+", RegexOptions.IgnoreCase), "HELLO"); 327 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), "Hello, world!")); 375 Assert.DoesNotMatch(new Regex(@"\w+"), null); 381 Assert.DoesNotMatch(new Regex(@"\d"), "Hello"); 387 var ex = Record.Exception(() => Assert.DoesNotMatch(new Regex(@"\w"), "Hello, world!"));
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.AI.OpenAI (1)
OpenAIChatClient.cs (1)
790private static readonly Regex _invalidAuthorNameRegex = new(InvalidAuthorNamePattern, RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
337var 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.GenAI.LLaMA (1)
LlamaTokenizerHelper.cs (1)
52var preTokenizer = new RegexPreTokenizer(new Regex(_re), _specialTokens);
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 (3)
Model\SentencePieceBaseModel.cs (1)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Microsoft.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
1057preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
Microsoft.NET.Build.Containers (15)
ContainerHelpers.cs (1)
36private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
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); 142public static readonly Regex DigestRegexp = new(digestPat); 154private static readonly Regex anchoredDigestRegexp = new(anchoredDigest); 171public static readonly Regex NameRegexp = new(namePat); 186public static readonly Regex anchoredNameRegexp = new(anchoredName); 204public static readonly Regex ReferenceRegexp = new(referencePat); 218public static readonly Regex IdentifierRegexp = new(identifier); 232public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 244private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 258private 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)
118var regex = new Regex(pattern, regexOptions);
Microsoft.NET.Sdk.StaticWebAssets.Tests (1)
StaticWebAssets\ComputeCssScopesTests.cs (1)
33!string.IsNullOrEmpty(item) && new Regex("b-[a-z0-9]+").IsMatch(item));
Microsoft.NET.TestFramework (1)
Assertions\FileInfoAssertions.cs (1)
62var regex = new Regex(pattern, RegexOptions.Multiline | RegexOptions.CultureInvariant);
Microsoft.TemplateEngine.Cli (1)
TemplateInvoker.cs (1)
150Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.VisualBasic.Core (4)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (4)
1204m_DelimiterRegex = New Regex(Builder.ToString(0, Builder.Length - 1)) 1206m_DelimiterWithEndCharsRegex = New Regex(Builder.ToString()) 1348m_BeginQuotesRegex = New Regex(pattern) 1473Private m_WhiteSpaceRegEx As Regex = New Regex("\s")
MSBuildTaskHost (17)
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
QuarantineTools.Tests (4)
QuarantineScriptTests.cs (4)
196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/dotnet/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/dotnet/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/dotnet/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
Roslyn.Diagnostics.Analyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.VisualStudio.Next.UnitTests (1)
UnifiedSettings\UnifiedSettingsTests.cs (1)
282var regex = new Regex("""
RoutingSandbox (1)
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
RoutingWebSite (1)
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
sdk-tasks (2)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
ZipFileCreateFromDirectory.cs (1)
70regexes[i] = new Regex(ExcludePatterns[i].ItemSpec, RegexOptions.IgnoreCase);
SemanticSearch.BuildTask (2)
GenerateFilteredReferenceAssembliesTask.cs (2)
48private static readonly Regex s_lineSyntax = new(""" 274=> new("^" + string.Join(".*", pattern.Trim().Split('*').Select(Regex.Escape)) + "$",
SemanticSearch.BuildTask.UnitTests (8)
GenerateFilteredReferenceAssembliesTaskTests.cs (8)
115new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E.*"), IsIncluded: true), 116new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E`1"), IsIncluded: false)); 160new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 161new ApiPattern(SymbolKindFlags.Method, new Regex(@"I.M1"), IsIncluded: false)); 200new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 201new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.get_.*"), IsIncluded: false), 202new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.set_.*"), IsIncluded: false), 203new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.get_P2"), IsIncluded: true));
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (2)
113? new Regex(Pattern) 114: 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.Drawing.Common.Tests (1)
System\Drawing\Imaging\ImageCodecInfoTests.cs (1)
92Regex extRegex = new(@"^(\*\.\w+(;(\*\.\w+))*;)?" +
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
140regexBypassList[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 (3)
System\Text\RegularExpressions\Regex.Cache.cs (2)
125regex = new Regex(pattern, culture); 144regex = new Regex(pattern, options, matchTimeout, culture);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
48Regex whitespaceRegex = new(@"\s");
TaskUsageLogger (1)
TaskUsageLogger.cs (1)
47private static readonly Regex s_msbuildPropertyRegex = new Regex(@"[\$][\(](?<name>.*?)[\)]", RegexOptions.ExplicitCapture);
Templates.Blazor.Tests (1)
BlazorWasmTemplateTest.cs (1)
118var serviceWorkerAssetsManifestVersionMatch = new Regex(@"^\s*\""version\"":\s*(\""[^\""]+\"")", RegexOptions.Multiline)
Text.Analyzers (6)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
27private static readonly Regex _versionParser = new Regex(@"^(?<lb>[\(\[])?(?<range>\d+(-\d+)?)(?<hb>[\)\]])?$");
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
20static readonly Regex RuntimeIdRegex = new Regex(@"(?<os>[A-Za-z0-9]+)(\.(?<version>[0-9\.]+))?(?<arch>\-[A-Za-z0-9]+)?(?<extra>\-[A-Za-z0-9]+)?");
1860 references to Regex
AnalyzerRunner (1)
Options.cs (1)
162var expression = new Regex(arg.Substring("/editperf:".Length), RegexOptions.Compiled | RegexOptions.IgnoreCase);
aspire (98)
Commands\NewCommand.cs (2)
281internal static partial Regex GetProjectNameRegex(); 290var regex = GetProjectNameRegex();
Projects\ProjectUpdater.cs (1)
336internal static partial Regex SdkDirectiveRegex();
RegexGenerator.g.cs (76)
24internal static partial global::System.Text.RegularExpressions.Regex GetProjectNameRegex() => global::System.Text.RegularExpressions.Generated.GetProjectNameRegex_0.Instance; 46internal static partial global::System.Text.RegularExpressions.Regex SdkDirectiveRegex() => global::System.Text.RegularExpressions.Generated.SdkDirectiveRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex HeaderLevel6Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel6Regex_2.Instance; 94private static partial global::System.Text.RegularExpressions.Regex HeaderLevel5Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel5Regex_3.Instance; 118private static partial global::System.Text.RegularExpressions.Regex HeaderLevel4Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel4Regex_4.Instance; 142private static partial global::System.Text.RegularExpressions.Regex HeaderLevel3Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel3Regex_5.Instance; 166private static partial global::System.Text.RegularExpressions.Regex HeaderLevel2Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel2Regex_6.Instance; 190private static partial global::System.Text.RegularExpressions.Regex HeaderLevel1Regex() => global::System.Text.RegularExpressions.Generated.HeaderLevel1Regex_7.Instance; 210private static partial global::System.Text.RegularExpressions.Regex BoldDoubleAsterisksRegex() => global::System.Text.RegularExpressions.Generated.BoldDoubleAsterisksRegex_8.Instance; 230private static partial global::System.Text.RegularExpressions.Regex BoldDoubleUnderscoresRegex() => global::System.Text.RegularExpressions.Generated.BoldDoubleUnderscoresRegex_9.Instance; 254private static partial global::System.Text.RegularExpressions.Regex ItalicSingleAsteriskRegex() => global::System.Text.RegularExpressions.Generated.ItalicSingleAsteriskRegex_10.Instance; 278private static partial global::System.Text.RegularExpressions.Regex ItalicSingleUnderscoreRegex() => global::System.Text.RegularExpressions.Generated.ItalicSingleUnderscoreRegex_11.Instance; 298private static partial global::System.Text.RegularExpressions.Regex StrikethroughRegex() => global::System.Text.RegularExpressions.Generated.StrikethroughRegex_12.Instance; 322private static partial global::System.Text.RegularExpressions.Regex CodeBlockRegex() => global::System.Text.RegularExpressions.Generated.CodeBlockRegex_13.Instance; 342private static partial global::System.Text.RegularExpressions.Regex InlineCodeRegex() => global::System.Text.RegularExpressions.Generated.InlineCodeRegex_14.Instance; 365private static partial global::System.Text.RegularExpressions.Regex ImageRegex() => global::System.Text.RegularExpressions.Generated.ImageRegex_15.Instance; 388private static partial global::System.Text.RegularExpressions.Regex LinkRegex() => global::System.Text.RegularExpressions.Generated.LinkRegex_16.Instance; 407private static partial global::System.Text.RegularExpressions.Regex RemoveSpectreFormattingRegex() => global::System.Text.RegularExpressions.Generated.RemoveSpectreFormattingRegex_17.Instance; 423/// <summary>Custom <see cref="Regex"/>-derived type for the GetProjectNameRegex method.</summary> 441/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 444/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 555/// <summary>Custom <see cref="Regex"/>-derived type for the SdkDirectiveRegex method.</summary> 573/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 722/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel6Regex method.</summary> 740/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 743/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 948/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel5Regex method.</summary> 966/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 969/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1174/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel4Regex method.</summary> 1192/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1195/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1400/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel3Regex method.</summary> 1418/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1421/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1626/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel2Regex method.</summary> 1644/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1647/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1852/// <summary>Custom <see cref="Regex"/>-derived type for the HeaderLevel1Regex method.</summary> 1870/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1873/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2078/// <summary>Custom <see cref="Regex"/>-derived type for the BoldDoubleAsterisksRegex method.</summary> 2096/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2099/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2219/// <summary>Custom <see cref="Regex"/>-derived type for the BoldDoubleUnderscoresRegex method.</summary> 2237/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2240/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2360/// <summary>Custom <see cref="Regex"/>-derived type for the ItalicSingleAsteriskRegex method.</summary> 2378/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2381/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2548/// <summary>Custom <see cref="Regex"/>-derived type for the ItalicSingleUnderscoreRegex method.</summary> 2566/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2569/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2736/// <summary>Custom <see cref="Regex"/>-derived type for the StrikethroughRegex method.</summary> 2754/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2757/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2877/// <summary>Custom <see cref="Regex"/>-derived type for the CodeBlockRegex method.</summary> 2895/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2898/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3084/// <summary>Custom <see cref="Regex"/>-derived type for the InlineCodeRegex method.</summary> 3102/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3105/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3225/// <summary>Custom <see cref="Regex"/>-derived type for the ImageRegex method.</summary> 3243/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3246/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3395/// <summary>Custom <see cref="Regex"/>-derived type for the LinkRegex method.</summary> 3413/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3416/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3571/// <summary>Custom <see cref="Regex"/>-derived type for the RemoveSpectreFormattingRegex method.</summary> 3589/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3592/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3689/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 3693/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 3694internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 3697internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Utils\ConsoleActivityLogger.cs (1)
391private static readonly Regex s_urlRegex = new(
Utils\MarkdownToSpectreConverter.cs (17)
159var regex = new Regex(@"^>\s*(.*)$"); 205var spectreRegex = new Regex(spectrePattern); 227private static partial Regex HeaderLevel6Regex(); 230private static partial Regex HeaderLevel5Regex(); 233private static partial Regex HeaderLevel4Regex(); 236private static partial Regex HeaderLevel3Regex(); 239private static partial Regex HeaderLevel2Regex(); 242private static partial Regex HeaderLevel1Regex(); 245private static partial Regex BoldDoubleAsterisksRegex(); 248private static partial Regex BoldDoubleUnderscoresRegex(); 251private static partial Regex ItalicSingleAsteriskRegex(); 254private static partial Regex ItalicSingleUnderscoreRegex(); 257private static partial Regex StrikethroughRegex(); 260private static partial Regex CodeBlockRegex(); 263private static partial Regex InlineCodeRegex(); 266private static partial Regex ImageRegex(); 269private static partial Regex LinkRegex();
Utils\StringUtils.cs (1)
16private static partial Regex RemoveSpectreFormattingRegex();
Aspire.Azure.Storage.Blobs (9)
AzureBlobStorageContainerSettings.cs (1)
16private static partial Regex ContainerNameRegex();
RegexGenerator.g.cs (8)
22private static partial global::System.Text.RegularExpressions.Regex ResourceGroupValidCharacters() => global::System.Text.RegularExpressions.Generated.ResourceGroupValidCharacters_0.Instance; 38/// <summary>Custom <see cref="Regex"/>-derived type for the ResourceGroupValidCharacters 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> 147/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 151/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 152internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 155internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Azure.Storage.Queues (9)
AzureStorageQueueSettings.cs (1)
16private static partial Regex QueueNameRegex();
RegexGenerator.g.cs (8)
22private static partial global::System.Text.RegularExpressions.Regex ResourceGroupValidCharacters() => global::System.Text.RegularExpressions.Generated.ResourceGroupValidCharacters_0.Instance; 38/// <summary>Custom <see cref="Regex"/>-derived type for the ResourceGroupValidCharacters 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> 147/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 151/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 152internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 155internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Cli.Tests (1)
Projects\ProjectUpdaterTests.cs (1)
2011var regex = ProjectUpdater.SdkDirectiveRegex();
Aspire.Confluent.Kafka.Tests (9)
KafkaContainerFixture.cs (1)
86private static partial Regex KafkaReadyRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Dashboard (43)
Components\Layout\MobileNavMenu.razor.cs (2)
108private static Regex GetNonIndexPageRegex(string pageRelativeBasePath) 110pageRelativeBasePath = Regex.Escape(pageRelativeBasePath);
Components\Layout\MobileNavMenuEntry.cs (1)
9internal record MobileNavMenuEntry(string Text, Func<Task> OnClick, Icon? Icon = null, Regex? LinkMatchRegex = null);
ConsoleLogs\UrlParser.cs (2)
14private static readonly Regex s_urlRegEx = GenerateUrlRegEx(); 73public static partial Regex GenerateUrlRegEx();
Model\ConnectionStringParser.cs (2)
57private static partial Regex HostPortRegex(); 64private static partial Regex JdbcUrlRegex();
Model\ResourceOutgoingPeerResolver.cs (1)
19private static partial Regex HostRegex();
RegexGenerator.g.cs (32)
52public static partial global::System.Text.RegularExpressions.Regex GenerateUrlRegEx() => global::System.Text.RegularExpressions.Generated.GenerateUrlRegEx_0.Instance; 80private static partial global::System.Text.RegularExpressions.Regex HostPortRegex() => global::System.Text.RegularExpressions.Generated.HostPortRegex_1.Instance; 115private static partial global::System.Text.RegularExpressions.Regex JdbcUrlRegex() => global::System.Text.RegularExpressions.Generated.JdbcUrlRegex_2.Instance; 183private static partial global::System.Text.RegularExpressions.Regex HostRegex() => global::System.Text.RegularExpressions.Generated.HostRegex_3.Instance; 211private static partial global::System.Text.RegularExpressions.Regex MatchSecondsInTimeFormatPattern() => global::System.Text.RegularExpressions.Generated.MatchSecondsInTimeFormatPattern_4.Instance; 282private static partial global::System.Text.RegularExpressions.Regex GenerateRfc3339RegEx() => global::System.Text.RegularExpressions.Generated.GenerateRfc3339RegEx_5.Instance; 299private static partial global::System.Text.RegularExpressions.Regex NonAlphanumericRegex() => global::System.Text.RegularExpressions.Generated.NonAlphanumericRegex_6.Instance; 315/// <summary>Custom <see cref="Regex"/>-derived type for the GenerateUrlRegEx method.</summary> 333/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 336/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 760/// <summary>Custom <see cref="Regex"/>-derived type for the HostPortRegex method.</summary> 778/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 781/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1018/// <summary>Custom <see cref="Regex"/>-derived type for the JdbcUrlRegex method.</summary> 1036/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1039/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1376/// <summary>Custom <see cref="Regex"/>-derived type for the HostRegex method.</summary> 1394/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1397/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1546/// <summary>Custom <see cref="Regex"/>-derived type for the MatchSecondsInTimeFormatPattern method.</summary> 1564/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1567/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1769/// <summary>Custom <see cref="Regex"/>-derived type for the GenerateRfc3339RegEx method.</summary> 1787/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1790/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2232/// <summary>Custom <see cref="Regex"/>-derived type for the NonAlphanumericRegex method.</summary> 2250/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2253/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2337/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2341/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2342internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2345internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\InteractionHelpers.cs (1)
19private static partial Regex NonAlphanumericRegex();
Utils\FormatHelpers.cs (1)
36private static partial Regex MatchSecondsInTimeFormatPattern();
Aspire.Dashboard.Tests (5)
ConsoleLogsTests\UrlParserTests.cs (2)
101var regex = UrlParser.GenerateUrlRegEx(); 114var regex = UrlParser.GenerateUrlRegEx();
Markdown\MarkdownProcessorTests.cs (2)
49var count = Regex.Matches(html, Regex.Escape("code-block")).Count;
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (11)
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled); 563private 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 (32)
Dashboard\DashboardService.cs (1)
35private static partial Regex ApplicationNameRegex();
Dcp\DcpDependencyCheck.cs (1)
19private static partial Regex VersionRegex();
Dcp\DcpExecutor.cs (1)
58private static partial Regex ApplicationNameRegex();
Dcp\Model\ModelCommon.cs (1)
239bool isValid = Regex.IsMatch(candidate, @"^[[a-zA-Z_~][a-zA-Z0-9\-._~]*$");
RegexGenerator.g.cs (25)
32private static partial global::System.Text.RegularExpressions.Regex ApplicationNameRegex() => global::System.Text.RegularExpressions.Generated.ApplicationNameRegex_0.Instance; 51private static partial global::System.Text.RegularExpressions.Regex VersionRegex() => global::System.Text.RegularExpressions.Generated.VersionRegex_1.Instance; 80private static partial global::System.Text.RegularExpressions.Regex ApplicationNameRegex() => global::System.Text.RegularExpressions.Generated.ApplicationNameRegex_0.Instance; 137private static partial global::System.Text.RegularExpressions.Regex ImageNameRegex() => global::System.Text.RegularExpressions.Generated.ImageNameRegex_2.Instance; 208private static partial global::System.Text.RegularExpressions.Regex GenerateRfc3339RegEx() => global::System.Text.RegularExpressions.Generated.GenerateRfc3339RegEx_3.Instance; 225private static partial global::System.Text.RegularExpressions.Regex NonAlphanumericRegex() => global::System.Text.RegularExpressions.Generated.NonAlphanumericRegex_4.Instance; 241/// <summary>Custom <see cref="Regex"/>-derived type for the ApplicationNameRegex method.</summary> 262/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 265/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 414/// <summary>Custom <see cref="Regex"/>-derived type for the VersionRegex method.</summary> 433/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 436/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 552/// <summary>Custom <see cref="Regex"/>-derived type for the ImageNameRegex method.</summary> 573/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1511/// <summary>Custom <see cref="Regex"/>-derived type for the GenerateRfc3339RegEx method.</summary> 1530/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1533/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1975/// <summary>Custom <see cref="Regex"/>-derived type for the NonAlphanumericRegex method.</summary> 1994/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1997/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2081/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2085/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2086internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2089internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\InteractionHelpers.cs (1)
19private static partial Regex NonAlphanumericRegex();
Utils\ContainerReferenceParser.cs (1)
40private static partial Regex ImageNameRegex();
Aspire.Hosting.Azure (9)
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
44private static partial Regex ResourceGroupValidCharacters();
RegexGenerator.g.cs (8)
22private static partial global::System.Text.RegularExpressions.Regex ResourceGroupValidCharacters() => global::System.Text.RegularExpressions.Generated.ResourceGroupValidCharacters_0.Instance; 38/// <summary>Custom <see cref="Regex"/>-derived type for the ResourceGroupValidCharacters 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> 147/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 151/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 152internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 155internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Hosting.Azure.KeyVault (9)
AzureKeyVaultResourceExtensions.cs (1)
301private static partial Regex AzureKeyVaultSecretNameRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Hosting.DevTunnels (10)
DevTunnelResourceBuilderExtensions.cs (2)
717private static partial Regex TunnelIdRegex(); 720private static partial Regex LabelRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
284Match match1 = Regex.Match(fileContents, pattern1); 286Match match2 = Regex.Match(fileContents, pattern2);
Aspire.Hosting.Python (10)
PythonVersionDetector.cs (2)
108private static partial Regex RequiresPythonRegex(); 111private static partial Regex PythonVersionOutputRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Aspire.Hosting.SqlServer (9)
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
SqlServerBuilderExtensions.cs (1)
23internal static partial Regex GoStatements();
Aspire.Hosting.Tests (5)
DistributedApplicationTests.cs (4)
1356var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1364var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}")); 1414var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1422var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}"));
Helpers\KubernetesHelper.cs (1)
34if (Regex.IsMatch(name, resourceNamePattern) && ready(r))
Aspire.Microsoft.Data.SqlClient (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Playground.Tests (1)
ProjectSpecificTests.cs (1)
87output = Regex.Replace(output, pattern: @"(?<=http:\/\/127\.0\.0\.1:)\d+", replacement: "*");
Aspire.Templates.Tests (15)
AppHostTemplateTests.cs (1)
39private static partial Regex AppHostPackageReferenceRegex();
BuildAndRunTemplateTests.cs (1)
175private static partial Regex AppHostVersionRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
TemplateTestsBase.cs (2)
17private static partial Regex CommentLineRegex(); 21private static partial Regex GeneratedClassNameFixupRegex();
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled); 563private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
BuildActionTelemetryTable (10)
Program.cs (2)
239var regex = ChangeOfCaseRegex(); 373private static partial Regex ChangeOfCaseRegex();
RegexGenerator.g.cs (8)
43private static partial global::System.Text.RegularExpressions.Regex ChangeOfCaseRegex() => global::System.Text.RegularExpressions.Generated.ChangeOfCaseRegex_0.Instance; 59/// <summary>Custom <see cref="Regex"/>-derived type for the ChangeOfCaseRegex method.</summary> 77/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 80/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 323/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 327/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 328internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 331internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
BuildBoss (2)
CompilerNuGetCheckerUtil.cs (2)
100var regex = new Regex(@"^(.*?)\.\d.*\.nupkg$"); 432return Regex.IsMatch(fileName, regex);
ConfigurationSchemaGenerator (9)
ConfigSchemaEmitter.cs (1)
40private static partial Regex BlankLinesInDocComment();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ConfigurationSchemaGenerator.Tests (9)
GeneratorTests.cs (1)
1608private static partial Regex TimeSpanRegex();
RegexGenerator.g.cs (8)
28private static partial global::System.Text.RegularExpressions.Regex BlankLinesInDocComment() => global::System.Text.RegularExpressions.Generated.BlankLinesInDocComment_0.Instance; 44/// <summary>Custom <see cref="Regex"/>-derived type for the BlankLinesInDocComment method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 286/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 290/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 291internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 294internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet (9)
Commands\Run\VirtualProjectBuildingCommand.cs (3)
1670public static partial Regex Whitespace { get; } 1673public static partial Regex DisallowedNameCharacters { get; } 1676public static partial Regex EscapedCompilerOption { get; }
Commands\Test\MTP\Terminal\AnsiDetector.cs (1)
18private static readonly Regex[] TerminalsRegexes =
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
57private static partial Regex GetFrameRegex();
Commands\Test\VSTest\TestCommand.cs (1)
643private static readonly Regex[] TerminalsRegexes =
Extensions\ParseResultExtensions.cs (1)
62return Regex.Split(formatString, @"{[0-9]+}"); // match the literal '{', followed by any of 0-9 one or more times, followed by the literal '}'
Telemetry\MacAddressGetter.cs (2)
47foreach (Match match in Regex.Matches(shelloutput, MacRegex, RegexOptions.IgnoreCase)) 49if (!Regex.IsMatch(match.Value, ZeroRegex))
dotnet.Tests (16)
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsForMultipleTFMs.cs (15)
34MatchCollection previousDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, useCurrentVersion: false, configuration)); 35MatchCollection currentDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("OtherTestProject", TestingConstants.Passed, useCurrentVersion: true, configuration)); 37MatchCollection skippedTestsMatches = Regex.Matches(result.StdOut!, "skipped Test2"); 38MatchCollection failedTestsMatches = Regex.Matches(result.StdOut!, "failed Test3"); 74MatchCollection previousDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, useCurrentVersion: false, configuration)); 75MatchCollection currentDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, useCurrentVersion: true, configuration)); 76MatchCollection currentDotnetOtherProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("OtherTestProject", TestingConstants.Passed, useCurrentVersion: true, configuration)); 78MatchCollection skippedTestsMatches = Regex.Matches(result.StdOut!, "skipped Test1"); 79MatchCollection failedTestsMatches = Regex.Matches(result.StdOut!, "failed Test2"); 80MatchCollection timeoutTestsMatches = Regex.Matches(result.StdOut!, @"failed \(canceled\) Test3"); 81MatchCollection errorTestsMatches = Regex.Matches(result.StdOut!, "failed Test4"); 82MatchCollection canceledTestsMatches = Regex.Matches(result.StdOut!, @"failed \(canceled\) Test5"); 190MatchCollection previousDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, useCurrentVersion: false, configuration)); 191MatchCollection currentDotnetProjectMatches = Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", TestingConstants.Failed, useCurrentVersion: true, configuration)); 193MatchCollection failedTestsMatches = Regex.Matches(result.StdOut!, "failed TestMethod3");
CommandTests\Test\GivenDotnetTestBuildsAndRunsTestsWithDifferentOptions.cs (1)
32Regex.Matches(result.StdOut!, RegexPatternHelper.GenerateProjectRegexPattern("TestProject", true, configuration, "exec", addVersionAndArchPattern: false));
dotnet-dev-certs (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
dotnet-format.UnitTests (1)
CodeFormatterTests.cs (1)
47private Regex FindFormattingLogLine => new Regex(@"((.*)\(\d+,\d+\): (.*))\r|((.*)\(\d+,\d+\): (.*))");
dotnet-new.IntegrationTests (8)
DotnetNewDetailsTest.Approval.cs (1)
221var match = Regex.Match(stdOut ?? string.Empty, @"Package version:\s*(\S+)");
DotnetNewInstallTests.cs (2)
249.And.HaveStdOutMatching("\\[\\d{4}\\-\\d{2}\\-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{1,3}\\] " + Regex.Escape("[Debug] [Microsoft.TemplateEngine.Edge.Installers.NuGet.NuGetInstaller] => [Execute]: Microsoft.DotNet.Web.ProjectTemplates.5.0 is not a local NuGet package.")) 250.And.HaveStdOutMatching("\\[\\d{4}\\-\\d{2}\\-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{1,3}\\] " + Regex.Escape("[Debug] [Microsoft.TemplateEngine.Edge.Installers.NuGet.NuGetInstaller] => [Execute]: Microsoft.DotNet.Web.ProjectTemplates.5.0 is identified as the downloadable NuGet package."));
DotnetNewLocaleTests.cs (1)
65.HaveStdOutMatching(Regex.Escape(expectedName) + ".*TestAssets.TemplateWithLocalization");
DotnetNewTestTemplatesTests.cs (1)
273var packageRefMatches = Regex.Matches(
DotnetNewUninstallTests.cs (2)
111.And.HaveStdOutMatching($"^\\s*dotnet new uninstall .*TemplateResolution{Regex.Escape(Path.DirectorySeparatorChar.ToString())}DifferentLanguagesGroup{Regex.Escape(Path.DirectorySeparatorChar.ToString())}BasicFSharp$", RegexOptions.Multiline);
VerifyScrubbers.cs (1)
49string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
dotnet-svcutil-lib (17)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
147private static volatile Regex s_outputRegWithFileAndLine; 148private static volatile Regex s_outputRegSimple;
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>", ""));
dotnet-watch (6)
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();
dotnet-watch.Tests (11)
Build\EvaluationTests.cs (2)
563foreach (var line in output.SkipWhile(l => !Regex.IsMatch(l, "dotnet watch ⌚ Watching ([0-9]+) file[(]s[)] for changes")).Skip(1)) 565var match = Regex.Match(line, $"> ([^{Path.PathSeparator}]*)({Path.PathSeparator}(.*))?");
TestUtilities\AssertEx.cs (1)
258public static void ContainsPattern(Regex expected, IEnumerable<string> items)
TestUtilities\WatchableApp.cs (8)
38public void AssertOutputContains(Regex pattern) 44private static Regex GetPattern(MessageDescriptor descriptor, string projectDisplay = null) 45=> new Regex(Regex.Replace(Regex.Escape((projectDisplay != null ? $"[{projectDisplay}] " : "") + descriptor.Format), @"\\\{[0-9]+\}", ".*")); 60public async ValueTask WaitUntilOutputContains(Regex pattern, [CallerFilePath] string testPath = null, [CallerLineNumber] int testLine = 0) 75var pattern = GetPattern(descriptor, projectDisplay); 97var pattern = GetPattern(descriptor, projectDisplay); 101public Task<string> WaitForOutputLineContaining(Regex pattern, [CallerFilePath] string testPath = null, [CallerLineNumber] int testLine = 0)
GenerateDocumentationAndConfigFiles (7)
Program.cs (3)
382description = Regex.Replace(description, "(\r?\n)", "$1$1"); 387description = Regex.Replace(description, @"(?:http|ftp)s?:\/\/[^\s\]""']*(?:\/|[^\s\]""'\W])", "<$0>"); 415=> Regex.Replace(text, "(<.+?>)", "\\$1").Replace("*", @"\*");
ReleaseTrackingHelper.cs (4)
113if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 124if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 133if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 144if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
276if (!string.IsNullOrWhiteSpace(_context.FileName) && !Regex.IsMatch(_context.FileName, "^([A-Za-z0-9-_]+)$"))
IIS.FunctionalTests (8)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
319var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 354var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
70var expectedRegex = new Regex(EventLogHelpers.ShutdownMessage(result), RegexOptions.Singleline);
IIS.LongTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewHandler.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewShim.FunctionalTests (6)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.ShadowCopy.Tests (5)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
IISExpress.FunctionalTests (8)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (5)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline); 307$"Could not start stdout file redirection to '{Regex.Escape(file)}' with application base '{EscapedContentRoot(deploymentResult)}'."; 326return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' failed to start. Exception message:\r\n{subError}"; 330return $@"Application '{Regex.Escape(deploymentResult.ContentRoot)}\\' wasn't able to start. {subError}"; 353return Regex.Escape(contentRoot);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
319var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 354var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
illink (16)
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
InteropTests (1)
Helpers\WebsiteProcess.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: .*:(?<port>\d*)$");
Metrics (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Metrics.Legacy (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
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.App.Analyzers.Test (2)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (1)
49private static readonly Regex s_namedSpanStartRegex = new Regex(@"\{\| ([-_.A-Za-z0-9\+]+) \:",
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
170!Regex.IsMatch(ex.Message, "^While processing template '(.*?)', a replacement value for the token '(.*?)' could not be found."))
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (11)
UserJwtsTests.cs (11)
167var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 201var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 219var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 382var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 401var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 421var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 442var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 564var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 657var printMatches = Regex.Matches(_console.GetOutput(), "Signing Key: '(.*?)'"); 662var resetMatches = Regex.Matches(_console.GetOutput(), "New signing key created: '(.*?)'"); 683var printMatches = Regex.Matches(_console.GetOutput(), "Signing Key: '(.*?)'");
Microsoft.AspNetCore.Authentication.Negotiate (9)
Internal\LdapAdapter.cs (1)
18internal static partial Regex DistinguishedNameSeparatorRegex { get; }
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;
Microsoft.AspNetCore.Components (14)
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\Http\Routing\src\Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex AlphaRouteRegex { get; }
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.Endpoints.Tests (24)
EndpointHtmlRendererTest.cs (21)
85var match = Regex.Match(content, ComponentPattern); 175var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 219var match = Regex.Match(content, ComponentPattern); 257var match = Regex.Match(content, ComponentPattern); 293var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 343var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 402var match = Regex.Match(content, ComponentPattern); 434var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 495var firstMatch = Regex.Match(firstComponent, PrerenderedComponentPattern, RegexOptions.Multiline); 499var secondMatch = Regex.Match(secondComponent, ComponentPattern); 553var match = Regex.Match(content, ComponentPattern); 592var match = Regex.Match(content, ComponentPattern); 631var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 682var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 1207var serverMarkerMatch = Regex.Match(lines[0], PrerenderedComponentPattern); 1208var serverNonPrerenderedMarkerMatch = Regex.Match(lines[1], ComponentPattern); 1210var webAssemblyMarkerMatch = Regex.Match(lines[2], PrerenderedComponentPattern); 1211var webAssemblyNonPrerenderedMarkerMatch = Regex.Match(lines[3], ComponentPattern); 1311var numMarkers = Regex.Matches(content, MarkerPrefix).Count; 1316var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Singleline); 1649var wasmOptionsMatch = Regex.Match(content, WebAssemblyOptionsPattern);
RazorComponentResultTest.cs (3)
403private static readonly Regex TemplateElementComponentIdRegex = new Regex("blazor-component-id=\"\\d+\""); 404private static readonly Regex OpenBoundaryMarkerRegex = new Regex("<!--bl:\\d+-->"); 405private static readonly Regex CloseBoundaryMarkerRegex = new Regex("<!--/bl:\\d+-->");
Microsoft.AspNetCore.Components.Server.Tests (2)
Circuits\ComponentHubTest.cs (2)
35mockClientProxy.Verify(m => m.SendCoreAsync("JS.Error", It.Is<object[]>(s => Regex.Match((string)s[0], errorMessage).Success), It.IsAny<CancellationToken>()), Times.Once()); 197mockClientProxy.Verify(m => m.SendCoreAsync("JS.Error", It.Is<object[]>(s => Regex.Match((string)s[0], errorMessage).Success), It.IsAny<CancellationToken>()), Times.Once());
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.DataProtection.Tests (5)
AuthenticatedEncryption\ConfigurationModel\AuthenticatedEncryptorDescriptorTests.cs (5)
32int keyLengthInBits = Int32.Parse(Regex.Match(encryptionAlgorithm.ToString(), @"^AES_(?<keyLength>\d{3})_CBC$").Groups["keyLength"].Value, CultureInfo.InvariantCulture); 33string hashAlgorithm = Regex.Match(validationAlgorithm.ToString(), @"^HMAC(?<hashAlgorithm>.*)$").Groups["hashAlgorithm"].Value; 60int keyLengthInBits = Int32.Parse(Regex.Match(encryptionAlgorithm.ToString(), @"^AES_(?<keyLength>\d{3})_GCM$").Groups["keyLength"].Value, CultureInfo.InvariantCulture); 86int keyLengthInBits = Int32.Parse(Regex.Match(encryptionAlgorithm.ToString(), @"^AES_(?<keyLength>\d{3})_GCM$").Groups["keyLength"].Value, CultureInfo.InvariantCulture); 123int keyLengthInBits = Int32.Parse(Regex.Match(encryptionAlgorithm.ToString(), @"^AES_(?<keyLength>\d{3})_CBC$").Groups["keyLength"].Value, CultureInfo.InvariantCulture);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private 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}")}$)}}";
src\Grpc\JsonTranscoding\src\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.Grpc.Swagger (2)
src\Grpc\JsonTranscoding\src\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.Http.Microbenchmarks (2)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
367newSource = Regex.Replace(newSource, _interceptsLocationAttributeRegex, "%INTERCEPTSLOCATIONATTRIBUTE%"); 394if (Regex.IsMatch(actualLine, _interceptsLocationAttributeRegex))
Microsoft.AspNetCore.Identity.FunctionalTests (2)
MapIdentityApiTests.cs (2)
1361var confirmationMatch = Regex.Match(email.HtmlMessage, "href='(.*?)'"); 1373var confirmationMatch = Regex.Match(email.HtmlMessage, "code: (.*?)$");
Microsoft.AspNetCore.InternalTesting.Tests (4)
AssemblyTestLogTests.cs (3)
362private static readonly Regex TimestampRegex = new(@"\d+-\d+-\d+T\d+:\d+:\d+"); 363private static readonly Regex TimestampOffsetRegex = new(@"\d+\.\d+s"); 364private static readonly Regex DurationRegex = new(@"[^ ]+s$");
XunitLoggerProviderTest.cs (1)
82private static readonly Regex TimestampRegex = new Regex(@"\d+-\d+-\d+T\d+:\d+:\d+");
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.Rewrite.Tests (8)
IISUrlRewrite\InputParserTests.cs (4)
167var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)"); 173var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)"); 179var match = Regex.Match(input, "([^/]*)/?(.*)"); 185var match = Regex.Match(input, "(.+)");
IISUrlRewrite\ServerVariableTests.cs (2)
161var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)"); 167var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)");
PatternSegments\ConditionMatchSegmentTests.cs (1)
31var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)");
PatternSegments\RuleMatchSegmentTests.cs (1)
30var match = Regex.Match("foo/bar/baz", "(.*)/(.*)/(.*)");
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
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.Routing.Tests (1)
TestObjects\SlugifyParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2").ToLowerInvariant();
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISExpressDeployer.cs (1)
27private static readonly Regex UrlDetectorRegex = new Regex(@"^\s*Successfully registered URL ""(?<url>[^""]+)"" for site.*$");
Microsoft.AspNetCore.Server.Kestrel.Core (13)
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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private 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 (83)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (2)
23public SdkResolverManifest(string DisplayName, string Path, Regex ResolvableSdkRegex) 46public Regex ResolvableSdkRegex { get; private set; }
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
33private static Regex SectionMatcherRegex { get; } = new Regex(s_sectionMatcherPattern, RegexOptions.Compiled); 35private static Regex PropertyMatcherRegex { get; } = new Regex(s_propertyMatcherPattern, RegexOptions.Compiled);
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()));
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
158private static Regex s_originCategoryCodeTextExpression; 159private static Regex OriginCategoryCodeTextExpression => s_originCategoryCodeTextExpression ??= 162private static Regex s_originCategoryCodeTextExpression2; 163private static Regex OriginCategoryCodeTextExpression2 => s_originCategoryCodeTextExpression2 ??= 166private static Regex s_filenameLocationFromOrigin; 167private static Regex FilenameLocationFromOrigin => s_filenameLocationFromOrigin ??= 170private static Regex s_lineFromLocation; 171private static Regex LineFromLocation => s_lineFromLocation ??= 174private static Regex s_lineLineFromLocation; 175private static Regex LineLineFromLocation => s_lineLineFromLocation ??= 178private static Regex s_lineColFromLocation; 179private static Regex LineColFromLocation => s_lineColFromLocation ??= 182private static Regex s_lineColColFromLocation; 183private static Regex LineColColFromLocation => s_lineColColFromLocation ??= 186private static Regex s_lineColLineColFromLocation; 187private static Regex LineColLineColFromLocation => s_lineColLineColFromLocation ??=
Construction\ProjectRootElement.cs (2)
70private static Regex XmlDeclarationRegex => s_xmlDeclarationRegex ??= new Regex(XmlDeclarationPattern); 71private static Regex s_xmlDeclarationRegex;
Construction\Solution\SolutionFile.cs (4)
72private static Regex CrackProjectLineRegex => s_crackProjectLineRegex ??= new Regex(CrackProjectLinePattern, RegexOptions.Compiled); 73private static Regex CrackPropertyLineRegex => s_crackPropertyLineRegex ??= new Regex(CrackPropertyLinePattern, RegexOptions.Compiled); 75private static Regex s_crackProjectLineRegex; 76private static Regex s_crackPropertyLineRegex;
DebugUtils.cs (1)
73var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Definition\ToolsetReader.cs (2)
193var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander.cs (10)
3454internal static Regex ItemMetadataRegex => s_itemMetadataRegex ??= 3457internal static Regex s_itemMetadataRegex; 3489private static Regex s_nonTransformItemMetadataPattern; 3491internal static Regex NonTransformItemMetadataRegex => s_nonTransformItemMetadataPattern ??= 3516/// Copied from <see cref="Regex.Replace(string, MatchEvaluator, int, int)"/> and modified to use a <see cref="SpanBasedStringBuilder"/> rather than repeatedly allocating a <see cref="System.Text.StringBuilder"/>. This 3523/// <param name="regex">The <see cref="Regex"/> that will perform the matching.</param> 3524public static void ReplaceAndAppend(string input, Func<Match, MetadataMatchEvaluator, string> evaluator, MetadataMatchEvaluator metadataMatchEvaluator, SpanBasedStringBuilder stringBuilder, Regex regex) 3530/// Copied from <see cref="Regex.Replace(string, MatchEvaluator, int, int)"/> and modified to use a <see cref="SpanBasedStringBuilder"/> rather than repeatedly allocating a <see cref="System.Text.StringBuilder"/>. This 3539/// <param name="regex">The <see cref="Regex"/> that will perform the matching.</param> 3540public static void ReplaceAndAppend(string input, Func<Match, MetadataMatchEvaluator, string> evaluator, MetadataMatchEvaluator matchEvaluatorState, int count, int startat, SpanBasedStringBuilder stringBuilder, Regex regex)
Evaluation\Expander\WellKnownFunctions.cs (2)
901else if (string.Equals(methodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 905returnVal = Regex.Replace(arg1, arg2, arg3);
Evaluation\IntrinsicFunctions.cs (2)
49private static Regex s_registrySdkRegex; 50private static Regex RegistrySdkRegex => s_registrySdkRegex ??= new Regex(RegistrySdkSpecification, RegexOptions.IgnoreCase);
FileMatcher.cs (8)
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal)); 754Regex regexFileMatch, // can be null 777public Regex RegexFileMatch { get; } 1497out Regex regexFileMatch, 1519out Regex regexFileMatch, 1525GetFileSpecInfoWithRegexObjectCore(spec, out var regex, out var needsRec, out var isLegal); 1849Regex regexFileMatch; 1871Regex fileSpecRegex,
Globbing\MSBuildGlob.cs (7)
34public Regex Regex { get; } 36public GlobState(string globRoot, string fileSpec, bool isLegal, string fixedDirectoryPart, string wildcardDirectoryPart, string filenamePart, bool needsRecursion, Regex regex) 50private static readonly WeakValueDictionary<string, Regex> s_regexCache = new WeakValueDictionary<string, Regex>(); 57internal Regex TestOnlyRegex => _state.Value.Regex; 198Regex regex = null; 217Regex newRegex = new Regex(matchFileExpression, regexOptions);
Logging\TerminalLogger\TerminalLogger.cs (2)
273MatchCollection tlMatches = Regex.Matches(argsString, @"(?:/|-|--)(?:tl|terminallogger):(?'value'on|off|true|false|auto)", RegexOptions.IgnoreCase); 276MatchCollection verbosityMatches = Regex.Matches(argsString, @"(?:/|-|--)(?:v|verbosity):(?'value'\w+)", RegexOptions.IgnoreCase);
ProjectWriter.cs (4)
57private static Regex ItemVectorTransformRegex => itemVectorTransformPattern ??= 59private static Regex itemVectorTransformPattern; 61private static Regex ItemVectorTransformRawRegex => itemVectorTransformRawPattern ??= 63private static Regex itemVectorTransformRawPattern;
Resources\Constants.cs (1)
396availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple<string, Type>(null, typeof(Regex)));
Utilities\EngineFileUtilities.cs (6)
24private static List<Regex>? s_lazyWildCardExpansionRegexes; 565private static List<Regex> PopulateRegexFromEnvironment() 570return new List<Regex>(0); 574List<Regex> regexes = new List<Regex>(); 577Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\FileSpecMatchTester.cs (5)
19private readonly Regex _regex; 21private FileSpecMatcherTester(string currentDirectory, string unescapedFileSpec, string filenamePattern, Regex regex) 43Regex regex = null; 105private static void CreateRegexOrFilenamePattern(string unescapedFileSpec, string currentDirectory, out string filenamePattern, out Regex regex) 140out Regex regexObject,
Utilities\Utilities.cs (1)
305private static Regex XmlnsPattern { get; } = new Regex("xmlns=\"[^\"]*\"\\s*");
Microsoft.Build.BuildCheck.UnitTests (12)
EndToEndTests.cs (12)
65Regex.Matches(output, "BC0201: .* Property").Count.ShouldBe(2); 66Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 67Regex.Matches(output, "BC0203 .* Property").Count.ShouldBe(2); 130Regex.Matches(output.LogOutput, expectedDiagnostic).Count.ShouldBe(2); 218Regex regex = new Regex(@"(\d+) Warning\(s\)"); 244Regex.Matches(output, expectedDiagnostic).Count.ShouldBe(2); 354Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 355Regex.Matches(output, "BC0203: .* Property").Count.ShouldBe(38); 359Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 360Regex.Matches(output, "BC0203: .* Property").Count.ShouldBe(42); 396Regex.Matches(output, expectedDiagnostic).Count.ShouldBe(2); 474Regex.Matches(output, expectedDiagnostic).Count.ShouldBe(expectCheckTrigger ? 2 : 0);
Microsoft.Build.CommandLine.UnitTests (3)
MSBuildServer_Tests.cs (1)
352Regex regex = new(@$"{toFind}(\d+)");
XMake_Tests.cs (2)
2841Match match = Regex.Match(arguments, pattern); 2868Match match = Regex.Match(arguments, pattern);
Microsoft.Build.Engine.OM.UnitTests (10)
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Construction\WhiteSpacePreservation_Tests.cs (7)
451projectContents = Regex.Replace(projectContents, @"(?<!\r)\n", "\r\n", RegexOptions.Multiline); 452updatedProject = Regex.Replace(updatedProject, @"(?<!\r)\n", "\r\n", RegexOptions.Multiline); 456projectContents = Regex.Replace(projectContents, @"\r\n", "\n", RegexOptions.Multiline); 457updatedProject = Regex.Replace(updatedProject, @"\r\n", "\n", RegexOptions.Multiline); 506var crlfCount = Regex.Matches(projectResults, @"\r\n", RegexOptions.Multiline).Count; 507var nlCount = Regex.Matches(projectResults, @"\n").Count; 515Assert.Empty(Regex.Matches(projectResults, @"\r\n", RegexOptions.Multiline));
DebugUtils.cs (1)
73var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Microsoft.Build.Engine.UnitTests (16)
ConsoleLogger_Tests.cs (2)
670console.ToString().ShouldMatch($@"<{expectedColor}><cyan>\d\d:\d\d:\d\d\.\d\d\d\s+\d+><reset color>{Regex.Escape(file)}\({lineNumber}\): {subcategory} {expectedMessageType} {code}: {message} \(TaskId:\d+\){Environment.NewLine}<reset color>"); 674console.ToString().ShouldMatch($@"<cyan>\d\d:\d\d:\d\d\.\d\d\d\s+\d+><reset color><{expectedColor}>{Regex.Escape(file)}\({lineNumber}\): {subcategory} {expectedMessageType} {code}: {message}{Environment.NewLine}<reset color>");
Definition\ToolsVersion_Tests.cs (1)
976return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern);
Evaluation\ExpressionShredder_Tests.cs (4)
1250private static readonly Regex s_itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1254private static readonly Regex s_listOfItemVectorsWithoutSeparatorsPattern = 1271private static readonly Regex s_itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1279private static readonly Regex s_nonTransformItemMetadataPattern =
FileMatcher_Tests.cs (1)
2594Regex regexFileMatch;
FileUtilitiesRegex_Tests.cs (4)
22internal static readonly Regex DrivePattern = new Regex(@"^[A-Za-z]:$", RegexOptions.Compiled); 25internal static readonly Regex StartWithDrivePattern = new Regex(@"^[A-Za-z]:", RegexOptions.Compiled); 33internal static readonly Regex StartsWithUncPattern = new Regex(s_baseUncPattern, RegexOptions.Compiled); 36internal static readonly Regex UncPattern =
Graph\ProjectGraph_Tests.cs (2)
1873Regex.Matches(dot, "->").Count.ShouldBe(edgeCount); 1876Regex.Matches(dot, "label").Count.ShouldBe(graph.ProjectNodes.Count);
ProjectCache\ProjectCacheTests.cs (2)
807Regex.Matches(mockLogger.FullLog, $"{AssemblyMockCache}: GetCacheResultAsync for").Count.ShouldBe(graph.ProjectNodes.Count); 1662Regex.Matches(aString, substring).Count.ShouldBe(expectedOccurrences);
Microsoft.Build.Framework (2)
FileClassifier.cs (1)
170if (Regex.IsMatch(processName, $@".*\\MSBuild\\Current\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase))
Logging\AnsiDetector.cs (1)
16private static readonly Regex[] terminalsRegexes =
Microsoft.Build.Tasks.CodeAnalysis (7)
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.CodeAnalysis.Sdk (7)
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 (28)
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; }
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
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; }
DebugUtils.cs (1)
73var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Exec.cs (1)
424match = Regex.IsMatch(singleLine, regularExpression);
FileMatcher.cs (8)
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal)); 754Regex regexFileMatch, // can be null 777public Regex RegexFileMatch { get; } 1497out Regex regexFileMatch, 1519out Regex regexFileMatch, 1525GetFileSpecInfoWithRegexObjectCore(spec, out var regex, out var needsRec, out var isLegal); 1849Regex regexFileMatch; 1871Regex fileSpecRegex,
FindInvalidProjectReferences.cs (1)
28private static partial Regex PlatformMonikerRegex { get; }
ManifestUtil\AssemblyIdentity.cs (2)
67private static partial Regex AssemblyNameRegex { get; } 179Regex re = AssemblyNameRegex;
NativeMethods.cs (1)
1254private static partial Regex AssemblyVersionRegex { get; }
ResolveSDKReference.cs (1)
43private static partial Regex SdkReferenceFormatRegex { get; }
Microsoft.Build.Tasks.UnitTests (5)
PortableTasks_Tests.cs (1)
79Regex.Matches(executionOutput, @"Microsoft\.Build\.(\w+\.)+dll").Count.ShouldBeGreaterThan(1);
ResourceHandling\GenerateResource_Tests.cs (3)
3767var matches = Regex.Matches(unformattedMessage, @"\{\d+.*?\}"); 3776sb.Append(Regex.Escape(segment)); 3783sb.Append(Regex.Escape(unformattedMessage.Substring(i)));
XslTransformation_Tests.cs (1)
52private readonly Regex _surroundMatch = new Regex("surround", RegexOptions.Multiline | RegexOptions.Compiled);
Microsoft.Build.UnitTests.Shared (5)
MockLogger.cs (2)
558var matches = Regex.Matches(FullLog, regexSearch ? message : Regex.Escape(message));
TestEnvironment.cs (3)
552if (Regex.IsMatch(file.Name, @"MSBuild_NodeShutdown_\d+\.txt") && 553Regex.IsMatch(contents, @"Node shutting down with reason BuildComplete and exception:\s*")) 561if (Regex.IsMatch(file.Name, @"MSBuild_CommTrace_PID_\d+\.txt"))
Microsoft.Build.Utilities.Core (32)
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
33directoryPath = Regex.Replace(directoryPath, "%VSINSTALLDIR%",
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
158private static Regex s_originCategoryCodeTextExpression; 159private static Regex OriginCategoryCodeTextExpression => s_originCategoryCodeTextExpression ??= 162private static Regex s_originCategoryCodeTextExpression2; 163private static Regex OriginCategoryCodeTextExpression2 => s_originCategoryCodeTextExpression2 ??= 166private static Regex s_filenameLocationFromOrigin; 167private static Regex FilenameLocationFromOrigin => s_filenameLocationFromOrigin ??= 170private static Regex s_lineFromLocation; 171private static Regex LineFromLocation => s_lineFromLocation ??= 174private static Regex s_lineLineFromLocation; 175private static Regex LineLineFromLocation => s_lineLineFromLocation ??= 178private static Regex s_lineColFromLocation; 179private static Regex LineColFromLocation => s_lineColFromLocation ??= 182private static Regex s_lineColColFromLocation; 183private static Regex LineColColFromLocation => s_lineColColFromLocation ??= 186private static Regex s_lineColLineColFromLocation; 187private static Regex LineColLineColFromLocation => s_lineColLineColFromLocation ??=
CommandLineBuilder.cs (4)
145private Regex _allowedUnquoted; 152private Regex _definitelyNeedQuotes; 157private Regex DefinitelyNeedQuotes => _definitelyNeedQuotes ??= 163private Regex AllowedUnquoted => _allowedUnquoted ??=
DebugUtils.cs (1)
73var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
FileMatcher.cs (8)
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal)); 754Regex regexFileMatch, // can be null 777public Regex RegexFileMatch { get; } 1497out Regex regexFileMatch, 1519out Regex regexFileMatch, 1525GetFileSpecInfoWithRegexObjectCore(spec, out var regex, out var needsRec, out var isLegal); 1849Regex regexFileMatch; 1871Regex fileSpecRegex,
Microsoft.Build.Utilities.UnitTests (1)
ToolTask_Tests.cs (1)
275Regex regex = new Regex(pattern);
Microsoft.Cci.Extensions (1)
Extensions\CSharp\CSharpCciExtensions.cs (1)
646private static Regex s_isKeywordRegex;
Microsoft.CodeAnalysis (22)
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, 119var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled)); 246sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 356sb.Append(Regex.Escape(currentChar.ToString()));
Diagnostic\DiagnosticInfo.cs (1)
134var matches = Regex.Matches(message, @"\{\d+[}:]");
RegexGenerator.g.cs (12)
36private static partial global::System.Text.RegularExpressions.Regex GetSectionMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetSectionMatcherRegex_0.Instance; 67private static partial global::System.Text.RegularExpressions.Regex GetPropertyMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetPropertyMatcherRegex_1.Instance; 83/// <summary>Custom <see cref="Regex"/>-derived type for the GetSectionMatcherRegex method.</summary> 102/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 105/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 518/// <summary>Custom <see cref="Regex"/>-derived type for the GetPropertyMatcherRegex method.</summary> 537/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 540/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 962/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 966/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 967internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 970internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
SourceGeneration\AdditionalSourcesCollection.cs (1)
27private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (21)
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\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.AnalyzerUtilities (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.BannedApiAnalyzers (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.CodeStyle (14)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (4)
CommandLineTests.cs (4)
4801var match = Regex.Match(output, pattern); 7025var patched = Regex.Replace(outWriter.ToString().Trim(), "version \\d+\\.\\d+\\.\\d+(-[\\w\\d]+)*", "version A.B.C-d"); 7052return Regex.Replace(s, "(\\((<developer build>|[a-fA-F0-9]{8})\\))", "(HASH)"); 7537Regex.Replace(output, "^.*a.cs", "a.cs", RegexOptions.Multiline).Trim());
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (1)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (1)
136Regex regex = null;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (2)
2495Match m = Regex.Match(il, @"\.data cil I_([0-9A-F]*) = bytearray"); 2612string[] actual = Regex.Matches(il, @"\.class nested assembly explicit ansi sealed '([^']*?)'").Cast<Match>().Select(m => m.Groups[1].Value).ToArray();
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (5)
Diagnostics\Suppression\SuppressionTests.cs (3)
1184Assert.All(Regex.Split(expected, "\r?\n"), line => Assert.False(HasTrailingWhitespace(line))); 1220var lines = Regex.Split(expected, "\r?\n"); 1254var lines = Regex.Split(expected, "\r?\n");
EnableNullable\EnableNullableTests.cs (2)
33if (!Regex.IsMatch(document.GetTextSynchronously(CancellationToken.None).ToString(), "#nullable ?enable")) 49if (!Regex.IsMatch(document.GetTextSynchronously(CancellationToken.None).ToString(), "#nullable ?restore"))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\SemanticModelAPITests.cs (2)
4060for (var match = System.Text.RegularExpressions.Regex.Match(source, " => x"); match.Success; match = match.NextMatch()) 4088for (var match = System.Text.RegularExpressions.Regex.Match(source, " => x"); match.Success; match = match.NextMatch())
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTrackingDiagnosticAnalyzer.cs (1)
19private static readonly Regex s_omittedSyntaxKindRegex =
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.EditorFeatures (6)
DocumentationComments\CopilotGenerateDocumentationCommentProvider.cs (1)
265copilotText = Regex.Replace(copilotText, @"\r?\n", " ");
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
147var match = Regex.Match(key, diagnosticKey);
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (2)
136private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 152private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?");
LanguageServer\RazorInProcLanguageClient.cs (1)
84var regex = new Regex(regexExpression, RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1));
QuickInfo\OnTheFlyDocsView.xaml.cs (1)
135var quotaExceededMatch = Regex.Match(
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
60lines[i] = Regex.Replace(lines[i], "(?<=^( )*)( )", _ => "\t");
Semantics\SpeculationAnalyzerTestsBase.cs (1)
19protected readonly Regex UnderTestRegex = new(@"\[\|(?<content>.*?)\|\]");
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.Features (14)
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);
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\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
38private protected static readonly Regex s_timePropertiesRegex = new("[|](EmitDifferenceMilliseconds|TotalAnalysisMilliseconds)=[0-9]+");
EditAndContinue\SourceMarkers.cs (3)
19private static readonly Regex s_tags = new( 22public static readonly Regex ExceptionRegionPattern = new( 30private static readonly Regex s_trackingStatementPattern = new(
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\ProtocolConversions.cs (1)
44private static readonly Regex s_markdownEscapeRegex = new(@"([\\`\*_\{\}\[\]\(\)#+\-\.!<>])", RegexOptions.Compiled);
Handler\InlineCompletions\XmlSnippetParser.CodeSnippet.cs (1)
143_code = Regex.Replace(code.Value, "(?<!\r)\n", "\r\n");
Protocol\Internal\Converters\RegexConverter.cs (3)
16internal sealed class RegexConverter : JsonConverter<Regex> 18public override Regex? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 23public override void Write(Utf8JsonWriter writer, Regex value, JsonSerializerOptions options)
Protocol\Internal\VSInternalInlineCompletionOptions.cs (1)
21public Regex Pattern { get; set; }
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (1)
339var regex = new Regex(s_clientSideSectionPattern);
Microsoft.CodeAnalysis.NetAnalyzers.UnitTests (1)
Microsoft.NetCore.Analyzers\Runtime\DoNotCallEnumerableCastOrOfTypeWithIncompatibleTypesAnalyzerTests.cs (1)
157Regex.Match(".", "abc").Groups
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.PublicApiAnalyzers (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.ResxSourceGenerator (15)
AbstractResxGenerator.cs (2)
871private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 872private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.Test.Utilities (10)
CompilationVerifier.cs (3)
277private static readonly Regex s_headerCommentsRegex = new("""^\s*// Header size: [0-9]+\s*$""", RegexOptions.Multiline); 278private static readonly Regex s_codeSizeCommentsRegex = new("""^\s*// Code size(:) [0-9]+\s*""", RegexOptions.Multiline); 475actualMessage = Regex.Replace(actualMessage, @"\[[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\]", "");
Diagnostics\DiagnosticDescription.cs (2)
468if (Regex.Matches(messageFormat, @"\{\d+(:\d+)?\}") is { Count: > 0 } matches) 559if (Regex.Match(message, @"{\d+}").Success)
Diagnostics\DiagnosticsHelper.cs (1)
20var match = Regex.Match(source, pattern);
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
66private static readonly Regex s_omittedSyntaxKindRegex =
MarkedSource\MarkupTestFile.cs (1)
49private static readonly Regex s_namedSpanStartRegex = new Regex(@"\{\| ([-_.A-Za-z0-9\+]+) \:",
MarkedSource\SourceWithMarkedNodes.cs (2)
85private static readonly Regex s_tags = new Regex( 89private static readonly Regex s_markerPattern = new Regex(
Microsoft.CodeAnalysis.Workspaces (16)
Rename\RenameUtilities.cs (2)
252var regex = GetRegexForMatch(matchText); 289public static Regex GetRegexForMatch(string matchText)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
412var regex = RenameUtilities.GetRegexForMatch(renameText);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
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.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.Data.Analysis.Tests (7)
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.DotNet.ApiCompat.Task (3)
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.ApiCompat.Tests (3)
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.ApiCompat.Tool (3)
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)
82var match = Regex.Match(globalJson, $@"""dotnet""\s*:\s*""([^""]+)""");
src\GenerateResxSource.cs (2)
489private static readonly Regex _namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 490private static readonly Regex _numberParameterMatcher = new Regex(@"\{(\d+)\}", RegexOptions.Compiled);
src\LocateDotNet.cs (1)
61var match = Regex.Match(globalJson, @"""dotnet""\s*:\s*""([^""]+)""");
Microsoft.DotNet.Build.Tasks.Feed (10)
src\AzureDevOpsNugetFeedAssetPublisher.cs (1)
38var parsedUri = Regex.Match(_targetUrl, PublishingConstants.AzDoNuGetFeedPattern);
src\BlobFeedAction.cs (1)
42Match m = Regex.Match(expectedFeedUrl, feedRegex);
src\BlobUrlInfo.cs (2)
40Match hostNameMatch = Regex.Match(hostName, AccountNameAndEndpointRegex); 53Match containerAndBlobMatch = Regex.Match(path, ContainerAndBlobRegex);
src\BuildModelFactory.cs (2)
78private readonly Regex LegacyRepositoryUriPattern = new Regex( 285string replacementUri = $"{Regex.Unescape(AzureDevOpsHostPattern)}/{m.Groups["account"].Value}";
src\common\AzureConnectionStringBuildTask.cs (1)
39Regex storageConnectionStringRegex = new Regex("AccountName=(?<name>.+?);AccountKey=(?<key>.+?);");
src\PublishArtifactsInManifestBase.cs (3)
194private static Regex FourPartVersionRegex = new Regex(FourPartVersionPattern); 1314var parsedUri = Regex.Match(feedConfig.TargetURL, PublishingConstants.AzDoNuGetFeedPattern); 1674var parsedUri = Regex.Match(feedConfig.TargetURL, PublishingConstants.AzDoNuGetFeedPattern);
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
PublishArtifactsInManifestTests.cs (1)
65var matches = Regex.Match(uri, PublishingConstants.AzDoNuGetFeedPattern);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\GenerateCurrentVersion.cs (1)
97Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Build.Tasks.Workloads (2)
Utils.cs (1)
109string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
WorkloadPackageBase.cs (1)
258if (exclusionPatterns.Any(pattern => Regex.IsMatch(file, pattern)))
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
399return Regex.Escape(Path.DirectorySeparatorChar.ToString());
Microsoft.DotNet.GenAPI (1)
SyntaxRewriter\TypeDeclarationCSharpSyntaxRewriter.cs (1)
54rs = RemoveBaseType(rs, x => Regex.IsMatch(x.ToString(), $"global::System.IEquatable<.*{rs!.Identifier}>"));
Microsoft.DotNet.Git.IssueManager (3)
Clients\AzureDevOpsClient.cs (2)
17private static readonly Regex RepositoryUriPattern = new Regex( 20private static readonly Regex LegacyRepositoryUriPattern = new Regex(
Clients\GitHubClient.cs (1)
82Regex repositoryUriPattern = new Regex(@"^/(?<owner>[^/]+)/(?<repo>[^/]+)/?$");
Microsoft.DotNet.Helix.JobSender (2)
JobDefinition.cs (2)
207Regex illegalCharacters = new Regex("[^a-z0-9-]"); 208Regex multipleDashes = new Regex("-{2,}");
Microsoft.DotNet.Helix.Sdk (3)
FindDotNetCliPackage.cs (1)
74return Regex.Replace(text, @"\?[^ ]+", "");
ProvisioningProfileProvider.cs (2)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
Microsoft.DotNet.Helix.Sdk.Tests (3)
FindDotNetCliPackageTests.cs (3)
113buildEngineMock.BuildMessageEvents.Should().NotContain(x => Regex.IsMatch(x.Message, @"\?sv=[^ ]+")); 166buildEngineMock.BuildMessageEvents.Should().NotContain(x => Regex.IsMatch(x.Message, @"\?sv=[^ ]+")); 218buildEngineMock.BuildMessageEvents.Should().NotContain(x => Regex.IsMatch(x.Message, @"\?sv=[^ ]+"));
Microsoft.DotNet.HotReload.Client.Tests (1)
AssertEx.cs (1)
258public static void ContainsPattern(Regex expected, IEnumerable<string> items)
Microsoft.DotNet.Open.Api.Tools.Tests (8)
OpenApiAddFileTests.cs (4)
209var escapedPkgRef = Regex.Escape("<PackageReference Include=\"NSwag.ApiDescription.Client\" Version=\""); 210Assert.Single(Regex.Matches(content, escapedPkgRef)); 211var escapedApiRef = Regex.Escape($"<OpenApiReference Include=\"{nswagJsonFile}\""); 212Assert.Single(Regex.Matches(content, escapedApiRef));
OpenApiAddURLTests.cs (4)
415var escapedPkgRef = Regex.Escape("<PackageReference Include=\"NSwag.ApiDescription.Client\" Version=\""); 416Assert.Single(Regex.Matches(content, escapedPkgRef)); 417var escapedApiRef = Regex.Escape($"SourceUrl=\"{FakeOpenApiUrl}\""); 418Assert.Single(Regex.Matches(content, escapedApiRef));
Microsoft.DotNet.SignCheckLibrary (2)
Utils.cs (1)
41string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
Verification\Exclusions.cs (1)
162return Regex.IsMatch(value, regexPattern, RegexOptions.IgnoreCase);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\UsagePattern.cs (2)
26public Regex CreateRegex() 36string regex = Regex.Escape(IdentityGlob).Replace("\\*", ".*");
src\UsageReport\ValidateUsageAgainstBaseline.cs (1)
161Regex[] ignoreUsageRegexes = baseline.IgnorePatterns.NullAsEmpty()
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.VersionTools (2)
src\Dependencies\FileRegexUpdater.cs (2)
16public Regex Regex { get; set; } 66Regex regex,
Microsoft.DotNet.VersionTools.Tasks (3)
src\BaseDependenciesTask.cs (3)
82protected Regex CreateXmlUpdateRegex(string elementName, string contentGroupName) => 85protected Regex CreateMSBuildSdkUpdateRegex(string msbuildSdkName, string contentGroupName) => 324updater.Regex = CreateMSBuildSdkUpdateRegex(Regex.Escape(msbuildSdkName), nameof(msbuildSdkName));
Microsoft.DotNet.XUnitAssert.Tests (2)
StringAssertsTests.cs (2)
308 Assert.Throws<ArgumentNullException>(() => Assert.Matches((Regex?)null!, "Hello, world!")); 374 Assert.Throws<ArgumentNullException>(() => Assert.DoesNotMatch((Regex?)null!, "Hello, world!"));
Microsoft.Extensions.AI.Abstractions (4)
ChatCompletion\ChatResponseFormat.cs (1)
98private static partial Regex InvalidNameCharsRegex();
Functions\AIFunctionFactory.cs (3)
1091private static partial Regex PotentiallyJsonRegex(); 1135private static partial Regex CompilerGeneratedNameRegex(); 1145private 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)
104Match 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)
56jsonFromElement = 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)
90Regex.Replace(text, @"\s*", string.Empty);
VerbatimMultiPartHttpHandler.cs (2)
148return Regex.Replace(input, @"[^a-zA-Z0-9_ .,!?\r\n""=;\//\[\]-]", ""); 190Regex.Replace(text, @"\s*", string.Empty);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
789private static Regex InvalidAuthorNameRegex() => _invalidAuthorNameRegex; 790private static readonly Regex _invalidAuthorNameRegex = new(InvalidAuthorNamePattern, RegexOptions.Compiled);
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIAssistantChatClientIntegrationTests.cs (1)
86var matches = Regex.Matches(listing, @"thread_\w+");
OpenAIConversionTests.cs (1)
1258private static string RemoveWhitespace(string input) => Regex.Replace(input, @"\s+", "");
Microsoft.Extensions.AI.Templates.Tests (1)
VerifyScrubbers.cs (1)
50string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
404private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Image\OpenTelemetryImageGeneratorTests.cs (1)
160static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
148static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (1)
Linux\Resources\HardcodedValueFileSystem.cs (1)
40.Select(x => Regex.Match(x, pattern, RegexOptions.IgnoreCase))
Microsoft.Extensions.DotNetDeltaApplier.Tests (1)
AssertEx.cs (1)
258public static void ContainsPattern(Regex expected, IEnumerable<string> items)
Microsoft.Extensions.Http.Diagnostics (2)
Http\DownstreamDependencyMetadataManager.cs (1)
24private static readonly Regex _routeRegex = DownstreamDependencyMetadataManagerRegex.MakeRouteRegex();
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
19public static partial Regex MakeRouteRegex();
Microsoft.Extensions.Validation.GeneratorTests (1)
ValidationsGeneratorTestBase.cs (1)
35private static partial Regex InterceptsLocationRegex();
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)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private 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)
337var 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)
367var expected = Regex.Replace(data[0].A, "[,|_|'|\"|;|\\.]", "");
Microsoft.ML.Tokenizers (52)
Model\SentencePieceBaseModel.cs (2)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 62internal Regex? SpecialTokensRegex { get; }
Model\TiktokenTokenizer.cs (8)
1189private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1191private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1261private static partial Regex Cl100kBaseRegex(); 1264internal static partial Regex P50kBaseRegex(); 1267internal static partial Regex O200kBaseRegex(); 1291(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1451(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1491(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
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)
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>
Microsoft.NET.Build.Containers (17)
AuthHandshakeMessageHandler.cs (1)
439private static partial Regex BearerParameterSplitter();
ContainerHelpers.cs (1)
36private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
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); 142public static readonly Regex DigestRegexp = new(digestPat); 154private static readonly Regex anchoredDigestRegexp = new(anchoredDigest); 171public static readonly Regex NameRegexp = new(namePat); 186public static readonly Regex anchoredNameRegexp = new(anchoredName); 204public static readonly Regex ReferenceRegexp = new(referencePat); 218public static readonly Regex IdentifierRegexp = new(identifier); 232public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 244private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 258private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier); 265private static string literal(string s) => Regex.Escape(s);
Microsoft.NET.Build.Tasks.UnitTests (1)
GivenThatWeHaveErrorCodes.cs (1)
61var match = Regex.Match(message, "^NETSDK([0-9]{4}): ");
Microsoft.NET.Build.Tests (1)
AppHostTests.cs (1)
451Regex.Matches(result.StdOut, "NETSDK1113", RegexOptions.None).Count.Should().Be(Retries);
Microsoft.NET.Publish.Tests (1)
GivenThatWeWantToRunILLink.cs (1)
2329if ((useRegex && Regex.IsMatch(warning, expectedWarnings[i])) ||
Microsoft.NET.Sdk.BlazorWebAssembly.Tests (11)
StaticWebAssetsBaselineFactory.cs (7)
16private static partial Regex ScopedProjectBundleRegex(); 19private static partial Regex ScopedAppBundleRegex(); 22private static partial Regex FingerprintedSiteCssRegex(); 25private static partial Regex EmbeddedFingerprintExpression(); 28private static partial Regex JSInitializerRegex(); 31private static partial Regex JSModuleManifestRegex(); 33private static readonly IList<(Regex expression, string replacement)> WellKnownFileNamePatternsAndReplacements =
WasmPwaManifestTests.cs (4)
169var match = Regex.Match(version, "\\/\\* Manifest version: (.{8}) \\*\\/"); 185var updatedMatch = Regex.Match(updatedVersion, "\\/\\* Manifest version: (.{8}) \\*\\/"); 219var match = Regex.Match(version, "\\/\\* Manifest version: (.{8}) \\*\\/"); 231var updatedMatch = Regex.Match(updatedVersion, "\\/\\* Manifest version: (.{8}) \\*\\/");
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)
121Regex.Replace(jsModuleCandidatePath, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
MergeConfigurationProperties.cs (1)
97metadataValue = 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)
127Regex.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)
74private bool TryInferFingerprint(Regex[] fingerprintExpressions, string relativePath, out string fingerprint, out string newRelativePath) 78var regex = fingerprintExpressions[i]; 102private static Regex[] CreateFingerprintExpressions(ITaskItem[] fingerprintInferenceExpressions) 113var result = new Regex[fingerprintInferenceExpressions.Length]; 118var regex = new Regex(pattern, regexOptions);
Microsoft.NET.Sdk.StaticWebAssets.Tests (16)
ScopedCssIntegrationTests.cs (7)
154var counterScopeMatch = Regex.Match(counterContent, ".*button\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 158var indexScopeMatch = Regex.Match(indexContent, ".*h1\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 186var indexScopeMatch = Regex.Match(indexContent, ".*p\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 190var aboutScopeMatch = Regex.Match(aboutContent, ".*h2\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 194var contactScopeMatch = Regex.Match(contactContent, ".*a\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 223var indexScopeMatch = Regex.Match(indexContent, ".*p\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase); 227var counterScopeMatch = Regex.Match(counterContent, ".*div\\[(.*)\\].*", RegexOptions.Multiline | RegexOptions.IgnoreCase);
StaticWebAssetEndpointsIntegrationTest.cs (2)
18private static partial Regex ProjectBundleRegex(); 21private static partial Regex AppBundleRegex();
StaticWebAssetsBaselineFactory.cs (7)
16private static partial Regex ScopedProjectBundleRegex(); 19private static partial Regex ScopedAppBundleRegex(); 22private static partial Regex FingerprintedSiteCssRegex(); 25private static partial Regex EmbeddedFingerprintExpression(); 28private static partial Regex JSInitializerRegex(); 31private static partial Regex JSModuleManifestRegex(); 33private static readonly IList<(Regex expression, string replacement)> WellKnownFileNamePatternsAndReplacements =
Microsoft.NET.TestFramework (5)
Assertions\CommandResultAssertions.cs (3)
102Regex.Match(_commandResult.StdOut ?? string.Empty, pattern, options).Success.Should().BeTrue(AppendDiagnosticsTo($"Matching the command output failed. Pattern: {pattern}{Environment.NewLine}")); 109Regex.Match(_commandResult.StdOut ?? string.Empty, pattern, options).Success.Should().BeFalse(AppendDiagnosticsTo($"The command output matched a pattern it should not have. Pattern: {pattern}{Environment.NewLine}")); 153Regex.Match(_commandResult.StdErr ?? string.Empty, pattern, options).Success.Should().BeTrue(AppendDiagnosticsTo($"Matching the command error output failed. Pattern: {pattern}{Environment.NewLine}"));
Assertions\FileInfoAssertions.cs (1)
62var regex = new Regex(pattern, RegexOptions.Multiline | RegexOptions.CultureInvariant);
Utilities\DotnetVersionHelper.cs (1)
13var match = Regex.Match(currentFramework, @"^net(\d+)\.(\d+)$");
Microsoft.TemplateEngine.Cli (2)
TemplateInvoker.cs (2)
150Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.VisualBasic.Core (8)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (8)
1192Dim EscapedDelimiter As String = Regex.Escape(m_Delimiters(i)) 1343Private ReadOnly Property BeginQuotesRegex() As Regex 1461Private m_DelimiterRegex As Regex 1464Private m_DelimiterWithEndCharsRegex As Regex 1470Private m_BeginQuotesRegex As Regex 1473Private m_WhiteSpaceRegEx As Regex = New Regex("\s") 1548Public Sub New(ByVal DelimiterRegex As Regex, ByVal SpaceChars As String) 1690Private m_DelimiterRegex As Regex
Microsoft.WebTools.AspireService.Tests (1)
AssertEx.cs (1)
258public static void ContainsPattern(Regex expected, IEnumerable<string> items)
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 (4)
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
DebugUtils.cs (1)
73var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
XMake.cs (1)
2286responseFileLine = Regex.Replace(responseFileLine, responseFilePathReplacement,
MSBuildTaskHost (3)
AnsiDetector.cs (1)
16private static readonly Regex[] terminalsRegexes =
BuildEnvironmentHelper.cs (2)
171Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 244Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
netstandard (1)
netstandard.cs (1)
2052[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.Regex))]
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)
102if (!System.Text.RegularExpressions.Regex.IsMatch(versionInput.Value, @"^\d+\.\d+\.\d+$"))
QuarantineTools.Tests (4)
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/dotnet/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/dotnet/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline);
Roslyn.Diagnostics.Analyzers (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.VisualStudio.Next.UnitTests (1)
UnifiedSettings\UnifiedSettingsTests.cs (1)
282var regex = new Regex("""
RoutingSandbox (1)
SlugifyParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromMilliseconds(100)).ToLowerInvariant();
RunTests (3)
Program.cs (3)
357if (Regex.IsMatch(name, pattern.Trim('\'', '"'))) 370if (Regex.IsMatch(name, pattern.Trim('\'', '"'))) 383TestRuntime.Core => Regex.IsMatch(dirName, @"^net\d+\."),
SDDLTests (1)
Program.cs (1)
107Match m = Regex.Match(sddlDescriptor, s_SDDL_Pattern);
sdk-tasks (4)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
ZipFileCreateFromDirectory.cs (3)
68Regex[] regexes = new Regex[ExcludePatterns.Length]; 82foreach (var regex in regexes)
SemanticSearch.BuildTask (4)
GenerateFilteredReferenceAssembliesTask.cs (4)
27Regex MetadataNamePattern, 48private static readonly Regex s_lineSyntax = new(""" 273internal static Regex ParseApiPattern(string pattern) 274=> new("^" + string.Join(".*", pattern.Trim().Split('*').Select(Regex.Escape)) + "$",
System (1)
src\libraries\shims\System\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 (13)
RegexGenerator.g.cs (12)
20private static partial global::System.Text.RegularExpressions.Regex DebuggerDisplayAttributeValueRegex() => global::System.Text.RegularExpressions.Generated.DebuggerDisplayAttributeValueRegex_0.Instance; 40private static partial global::System.Text.RegularExpressions.Regex ContainsNqSuffixRegex() => global::System.Text.RegularExpressions.Generated.ContainsNqSuffixRegex_1.Instance; 56/// <summary>Custom <see cref="Regex"/>-derived type for the DebuggerDisplayAttributeValueRegex method.</summary> 75/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 78/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 195/// <summary>Custom <see cref="Regex"/>-derived type for the ContainsNqSuffixRegex method.</summary> 214/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 217/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 360/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 364/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 365internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 368internal 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 (24)
RegexGenerator.g.cs (12)
20private static partial global::System.Text.RegularExpressions.Regex DebuggerDisplayAttributeValueRegex() => global::System.Text.RegularExpressions.Generated.DebuggerDisplayAttributeValueRegex_0.Instance; 40private static partial global::System.Text.RegularExpressions.Regex ContainsNqSuffixRegex() => global::System.Text.RegularExpressions.Generated.ContainsNqSuffixRegex_1.Instance; 56/// <summary>Custom <see cref="Regex"/>-derived type for the DebuggerDisplayAttributeValueRegex method.</summary> 75/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 78/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 195/// <summary>Custom <see cref="Regex"/>-derived type for the ContainsNqSuffixRegex method.</summary> 214/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 217/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 360/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 364/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 365internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 368internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (11)
50private static readonly Regex s_connectionStringRegex = CreateConnectionStringRegex(); 51private static readonly Regex s_connectionStringRegexOdbc = CreateConnectionStringRegexOdbc(); 55private static partial Regex CreateConnectionStringRegex(); 58private static partial Regex CreateConnectionStringRegexOdbc(); 66private static readonly Regex s_connectionStringValidKeyRegex = CreateConnectionStringValidKeyRegex(); // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static readonly Regex s_connectionStringQuoteValueRegex = CreateConnectionStringQuoteValueRegex(); // generally do not quote the value if it matches the pattern 68private static readonly Regex s_connectionStringQuoteOdbcValueRegex = CreateConnectionStringQuoteOdbcValueRegex(); // do not quote odbc value if it matches this pattern 72private static partial Regex CreateConnectionStringValidKeyRegex(); 74private static partial Regex CreateConnectionStringQuoteValueRegex(); 76private static partial Regex CreateConnectionStringQuoteOdbcValueRegex(); 435Regex parser = (firstKey ? s_connectionStringRegexOdbc : s_connectionStringRegex);
System\Data\Common\DBCommandBuilder.cs (1)
29private readonly Regex _parameterNameParser;
System.Data.Odbc (35)
RegexGenerator.g.cs (24)
76private static partial global::System.Text.RegularExpressions.Regex CreateConnectionStringRegex() => global::System.Text.RegularExpressions.Generated.CreateConnectionStringRegex_0.Instance; 134private static partial global::System.Text.RegularExpressions.Regex CreateConnectionStringRegexOdbc() => global::System.Text.RegularExpressions.Generated.CreateConnectionStringRegexOdbc_1.Instance; 157private static partial global::System.Text.RegularExpressions.Regex CreateConnectionStringValidKeyRegex() => global::System.Text.RegularExpressions.Generated.CreateConnectionStringValidKeyRegex_2.Instance; 176private static partial global::System.Text.RegularExpressions.Regex CreateConnectionStringQuoteValueRegex() => global::System.Text.RegularExpressions.Generated.CreateConnectionStringQuoteValueRegex_3.Instance; 202private static partial global::System.Text.RegularExpressions.Regex CreateConnectionStringQuoteOdbcValueRegex() => global::System.Text.RegularExpressions.Generated.CreateConnectionStringQuoteOdbcValueRegex_4.Instance; 218/// <summary>Custom <see cref="Regex"/>-derived type for the CreateConnectionStringRegex method.</summary> 239/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 242/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1458/// <summary>Custom <see cref="Regex"/>-derived type for the CreateConnectionStringRegexOdbc method.</summary> 1479/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1482/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2444/// <summary>Custom <see cref="Regex"/>-derived type for the CreateConnectionStringValidKeyRegex method.</summary> 2463/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2466/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2622/// <summary>Custom <see cref="Regex"/>-derived type for the CreateConnectionStringQuoteValueRegex method.</summary> 2641/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2644/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2723/// <summary>Custom <see cref="Regex"/>-derived type for the CreateConnectionStringQuoteOdbcValueRegex method.</summary> 2742/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2745/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2930/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2934/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2935internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2938internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (11)
50private static readonly Regex s_connectionStringRegex = CreateConnectionStringRegex(); 51private static readonly Regex s_connectionStringRegexOdbc = CreateConnectionStringRegexOdbc(); 55private static partial Regex CreateConnectionStringRegex(); 58private static partial Regex CreateConnectionStringRegexOdbc(); 66private static readonly Regex s_connectionStringValidKeyRegex = CreateConnectionStringValidKeyRegex(); // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static readonly Regex s_connectionStringQuoteValueRegex = CreateConnectionStringQuoteValueRegex(); // generally do not quote the value if it matches the pattern 68private static readonly Regex s_connectionStringQuoteOdbcValueRegex = CreateConnectionStringQuoteOdbcValueRegex(); // do not quote odbc value if it matches this pattern 72private static partial Regex CreateConnectionStringValidKeyRegex(); 74private static partial Regex CreateConnectionStringQuoteValueRegex(); 76private static partial Regex CreateConnectionStringQuoteOdbcValueRegex(); 435Regex parser = (firstKey ? s_connectionStringRegexOdbc : s_connectionStringRegex);
System.Drawing.Common.Tests (2)
System\Drawing\Imaging\ImageCodecInfoTests.cs (2)
92Regex extRegex = new(@"^(\*\.\w+(;(\*\.\w+))*;)?" + 93Regex.Escape(FilenameExtension) + @"(;\*\.\w+(;(\*\.\w+))*)?$",
System.Net.WebProxy (5)
System\Net\WebProxy.cs (5)
19private Regex[]? _regexBypassList; 134Regex[]? regexBypassList = null; 137regexBypassList = new Regex[bypassList.Count]; 168if (_regexBypassList is Regex[] regexBypassList) 183foreach (Regex r in regexBypassList)
System.Private.DataContractSerialization (13)
RegexGenerator.g.cs (12)
20private static partial global::System.Text.RegularExpressions.Regex DebuggerDisplayAttributeValueRegex() => global::System.Text.RegularExpressions.Generated.DebuggerDisplayAttributeValueRegex_0.Instance; 40private static partial global::System.Text.RegularExpressions.Regex ContainsNqSuffixRegex() => global::System.Text.RegularExpressions.Generated.ContainsNqSuffixRegex_1.Instance; 56/// <summary>Custom <see cref="Regex"/>-derived type for the DebuggerDisplayAttributeValueRegex method.</summary> 75/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 78/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 195/// <summary>Custom <see cref="Regex"/>-derived type for the ContainsNqSuffixRegex method.</summary> 214/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 217/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 360/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 364/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 365internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 368internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Runtime\Serialization\Globals.cs (1)
134public static partial Regex FullSRSInternalsVisibleRegex { get; }
System.Private.Xml (27)
RegexGenerator.g.cs (12)
20private static partial global::System.Text.RegularExpressions.Regex DebuggerDisplayAttributeValueRegex() => global::System.Text.RegularExpressions.Generated.DebuggerDisplayAttributeValueRegex_0.Instance; 40private static partial global::System.Text.RegularExpressions.Regex ContainsNqSuffixRegex() => global::System.Text.RegularExpressions.Generated.ContainsNqSuffixRegex_1.Instance; 56/// <summary>Custom <see cref="Regex"/>-derived type for the DebuggerDisplayAttributeValueRegex method.</summary> 75/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 78/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 195/// <summary>Custom <see cref="Regex"/>-derived type for the ContainsNqSuffixRegex method.</summary> 214/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 217/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 360/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 364/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 365internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 368internal 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)
2682private static partial Regex EnsureArrayIndexRegex { get; } 2685private static partial Regex P0Regex { get; } 3494private static partial Regex UnknownNodeNullAnyTypeRegex { get; } 3497private static partial Regex UnknownNodeObjectEmptyRegex { get; } 3500private static partial Regex UnknownNodeObjectNullRegex { get; } 3503private static partial Regex UnknownNodeObjectRegex { get; } 3506private 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 (14)
RegexGenerator.g.cs (12)
20private static partial global::System.Text.RegularExpressions.Regex DebuggerDisplayAttributeValueRegex() => global::System.Text.RegularExpressions.Generated.DebuggerDisplayAttributeValueRegex_0.Instance; 40private static partial global::System.Text.RegularExpressions.Regex ContainsNqSuffixRegex() => global::System.Text.RegularExpressions.Generated.ContainsNqSuffixRegex_1.Instance; 56/// <summary>Custom <see cref="Regex"/>-derived type for the DebuggerDisplayAttributeValueRegex method.</summary> 75/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 78/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 195/// <summary>Custom <see cref="Regex"/>-derived type for the ContainsNqSuffixRegex method.</summary> 214/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 217/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 360/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 364/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 365internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 368internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Text\Json\JsonHelpers.cs (2)
295public static readonly Regex IntegerRegex = CreateIntegerRegex(); 301private static partial Regex CreateIntegerRegex();
System.Text.RegularExpressions (81)
System\Text\RegularExpressions\GeneratedRegexAttribute.cs (3)
13/// or get-only properties that are typed to return <see cref="Regex"/>. 16/// When the <see cref="Regex"/> supports case-insensitive matches (either by passing <see cref="RegexOptions.IgnoreCase"/> or using the inline `(?i)` switch in the pattern) the regex 20/// equivalences will depend on the target framework at compile time. This differs from the rest of the <see cref="Regex"/> engines, which perform this transformation at run-time, meaning
System\Text\RegularExpressions\Match.cs (6)
40internal readonly Regex? _regex; 51internal Match(Regex? regex, int capcount, string? text, int textLength) : 100Regex? r = _regex; 119Regex? regex = _regex ?? throw new NotSupportedException(SR.NoResultOnFailed); 125return Regex.SegmentsToStringAndDispose(ref segments); 380internal MatchSparse(Regex regex, Hashtable caps, int capcount, string? text, int textLength) :
System\Text\RegularExpressions\MatchCollection.cs (2)
18private readonly Regex _regex; 25internal MatchCollection(Regex regex, string input, int startat)
System\Text\RegularExpressions\Regex.Cache.cs (13)
111public static Regex GetOrAdd(string pattern) 117Regex.ValidatePattern(pattern); 120Key key = new Key(pattern, culture.ToString(), RegexOptions.None, Regex.s_defaultMatchTimeout); 122Regex? regex = Get(key); 132public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 134Regex.ValidatePattern(pattern); 135Regex.ValidateOptions(options); 136Regex.ValidateMatchTimeout(matchTimeout); 141Regex? regex = Get(key); 151private static Regex? Get(Key key) 195private static void Add(Key key, Regex regex) 311private sealed class Node(Key key, Regex regex) 316public readonly Regex Regex = regex;
System\Text\RegularExpressions\Regex.EnumerateMatches.cs (5)
101/// The enumerator has no public constructor. The <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/> method returns a <see cref="Regex.ValueMatchEnumerator"/> 110private readonly Regex _regex; 119/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 122internal ValueMatchEnumerator(Regex regex, ReadOnlySpan<char> input, int startAt)
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (3)
180private readonly Regex _regex; 191/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 196internal ValueSplitEnumerator(Regex regex, ReadOnlySpan<char> input, int count, int startAt, bool rtl)
System\Text\RegularExpressions\Regex.Match.cs (1)
59/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate that the method should not time out.</param>
System\Text\RegularExpressions\Regex.Replace.cs (1)
155private static string Replace(MatchEvaluator evaluator, Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Split.cs (1)
72private static string[] Split(Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Timeout.cs (4)
19/// Setting this to a valid TimeSpan will cause that TimeSpan to be used as the timeout for <see cref="Regex"/> instances created 37/// The default timeout value to use if one isn't explicitly specified when creating the <see cref="Regex"/> 46/// <summary>Timeout for the execution of this <see cref="Regex"/>.</summary> 51/// The <see cref="MatchTimeout"/> property defines the approximate maximum time interval for a <see cref="Regex"/> instance to execute a single matching
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (17)
75TypeBuilder regexTypeBuilder = DefineType(_module, name, isPublic, isSealed: false, typeof(Regex)); 79if (matchTimeout != Regex.InfiniteMatchTimeout) 112_ilg!.Emit(OpCodes.Call, typeof(Regex).GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, Array.Empty<ParameterModifier>())!); 115Stfld(RegexField(nameof(Regex.pattern))); 118Stfld(RegexField(nameof(Regex.roptions))); 121Stfld(RegexField(nameof(Regex.factory))); 125if (matchTimeout == Regex.InfiniteMatchTimeout) 128_ilg.Emit(OpCodes.Ldsfld, RegexField(nameof(Regex.InfiniteMatchTimeout))); 136Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 141Stfld(RegexField(nameof(Regex.capsize))); 145GenerateCreateHashtable(RegexField(nameof(Regex.caps)), tree.CaptureNumberSparseMapping); 150GenerateCreateHashtable(RegexField(nameof(Regex.capnames)), tree.CaptureNameToNumberMapping); 161FieldInfo capslistField = RegexField(nameof(Regex.capslist)); 184Call(typeof(Regex).GetMethod(nameof(Regex.ValidateMatchTimeout), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!); 187Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 225typeof(Regex).GetField(fieldname, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)!;
System\Text\RegularExpressions\RegexCompilationInfo.cs (2)
18: this(pattern, options, name, fullnamespace, ispublic, Regex.s_defaultMatchTimeout) 39Regex.ValidateMatchTimeout(value);
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 (9)
102protected internal Regex? runregex; 114/// <summary>Used by a <see cref="Regex"/> object to scan the input <paramref name="text"/> looking for the next match.</summary> 118/// <see cref="ReadOnlySpan{T}"/>-based <see cref="Regex"/> methods are not supported from <see cref="Regex"/>-derived types 163protected Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick) => 171protected internal Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, TimeSpan timeout) 231private Match InternalScan(Regex regex, int textbeg, int textend) 276internal void InitializeForScan(Regex regex, ReadOnlySpan<char> text, int textstart, RegexRunnerMode mode) 343if (Regex.InfiniteMatchTimeout != timeout)
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (4)
17/// <inheritdoc cref="Regex.SaveDGML(TextWriter, int)"/> 20/// <inheritdoc cref="Regex.SampleMatches(int, int)"/> 23/// <inheritdoc cref="Regex.Explore(bool, bool, bool, bool, bool)"/> 175_checkTimeout = Regex.InfiniteMatchTimeout != matchTimeout;
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (1)
15/// <inheritdoc cref="Regex.SaveDGML(TextWriter, int)"/>
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Explore.cs (1)
12/// <inheritdoc cref="Regex.Explore(bool, bool, bool, bool, bool)"/>
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (1)
29/// <inheritdoc cref="Regex.SampleMatches(int, int)"/>
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
48Regex whitespaceRegex = new(@"\s");
System\Text\RegularExpressions\ValueMatch.cs (2)
11/// <see cref="Regex.ValueMatchEnumerator.Current"/> method when iterating over the results from calling <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/>.
System.Windows.Forms (10)
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 (10)
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\ComponentModel\Design\DesignerActionItem.cs (1)
27private static partial Regex SanitizeNameRegex();
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2241private static partial Regex ParenthesisRegex();
System.Windows.Forms.Tests (9)
RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex PlaceholdersPattern() => global::System.Text.RegularExpressions.Generated.PlaceholdersPattern_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the PlaceholdersPattern 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> 154/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 158/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 159internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 162internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ResourceStrings.cs (1)
11private static partial Regex PlaceholdersPattern();
TaskUsageLogger (1)
TaskUsageLogger.cs (1)
47private static readonly Regex s_msbuildPropertyRegex = new Regex(@"[\$][\(](?<name>.*?)[\)]", RegexOptions.ExplicitCapture);
Templates.Blazor.Tests (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
Templates.Blazor.WebAssembly.Auth.Tests (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
Templates.Blazor.WebAssembly.Tests (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
Templates.Mvc.Tests (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
Templates.Tests (21)
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> 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> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 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\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
793private static partial Regex OpenSslVersionRegex { get; } 875private static partial Regex OpenSslHashFilenameRegex { get; } 882private static partial Regex OpenSslCertificateExtensionRegex { get; }
Test.Utilities (1)
AdditionalFileProvider.cs (1)
49=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Text.Analyzers (13)
src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
27private static readonly Regex _versionParser = new Regex(@"^(?<lb>[\(\[])?(?<range>\d+(-\d+)?)(?<hb>[\)\]])?$");
XmlFileLogger (1)
XmlFileLogger.cs (1)
136var match = Regex.Match(messageArgs.Message, taskAssemblyPattern);
xunit.assert (4)
StringAsserts.cs (4)
182 if (actualString == null || !Regex.IsMatch(actualString, expectedRegexPattern)) 193 Regex expectedRegex, 222 if (actualString != null && Regex.IsMatch(actualString, expectedRegexPattern)) 233 Regex expectedRegex,
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
20static readonly Regex RuntimeIdRegex = new Regex(@"(?<os>[A-Za-z0-9]+)(\.(?<version>[0-9\.]+))?(?<arch>\-[A-Za-z0-9]+)?(?<extra>\-[A-Za-z0-9]+)?");