382 instantiations of Regex
AnalyzerRunner (1)
Options.cs (1)
162var expression = new Regex(arg.Substring("/editperf:".Length), RegexOptions.Compiled | RegexOptions.IgnoreCase);
Aspire.Dashboard (2)
Components\Layout\MobileNavMenu.razor.cs (2)
43LinkMatchRegex: new Regex($"^{DashboardUrls.ResourcesUrl()}$") 100return new Regex($"^({pageRelativeBasePath}|{pageRelativeBasePath}/.+)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Aspire.EndToEnd.Tests (2)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\WorkloadTesting\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)
49var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Aspire.Workload.Tests (2)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
BuildActionTelemetryTable (1)
Program.cs (1)
555var regex = new Regex(@"
BuildBoss (1)
CompilerNuGetCheckerUtil.cs (1)
101var regex = new Regex(@"^(.*?)\.\d.*\.nupkg$");
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})_");
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)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
71var 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)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var 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*)$");
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)
51private 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); 60private 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)
51private 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); 60private 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 (24)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
128manifest.ResolvableSdkRegex = new Regex(pattern, regexOptions, TimeSpan.FromMilliseconds(SdkResolverPatternRegexTimeoutMsc));
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
CanonicalError.cs (8)
56() => new Regex( 76() => new Regex( 82() => new Regex( 94() => new Regex( // Example: line 102() => new Regex( // Example: line-line 112() => new Regex( // Example: line,col 122() => new Regex( // Example: line,col-col 134() => new Regex( // Example: line,col,line,col
Construction\ProjectRootElement.cs (1)
64private static readonly Lazy<Regex> XmlDeclarationRegEx = new Lazy<Regex>(() => new Regex(@"\A\s*\<\?\s*xml.*\?\>\s*\Z"), isThreadSafe: true);
Construction\Solution\SolutionFile.cs (2)
45() => new Regex( 63() => new Regex(
Definition\ToolsetReader.cs (1)
199var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander.cs (2)
3101() => new Regex(ItemMetadataSpecification, 3124() => new Regex(
Evaluation\IntrinsicFunctions.cs (1)
40private static readonly Lazy<Regex> RegistrySdkRegex = new Lazy<Regex>(() => new Regex(@"^HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Microsoft SDKs\\Windows\\v(\d+\.\d+)$", RegexOptions.IgnoreCase));
FileMatcher.cs (2)
1513regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2156matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Globbing\MSBuildGlob.cs (1)
217Regex newRegex = new Regex(matchFileExpression, regexOptions);
ProjectWriter.cs (2)
47new Regex(itemVectorTransformSpecification, 63new Regex(itemVectorTransformRawSpecification,
Utilities\EngineFileUtilities.cs (1)
549Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\Utilities.cs (1)
298private static readonly Regex s_xmlnsPattern = new Regex("xmlns=\"[^\"]*\"\\s*");
Microsoft.Build.BuildCheck.UnitTests (1)
EndToEndTests.cs (1)
216Regex regex = new Regex(@"(\d+) Warning\(s\)");
Microsoft.Build.CommandLine.UnitTests (1)
MSBuildServer_Tests.cs (1)
346Regex regex = new(@$"{toFind}(\d+)");
Microsoft.Build.Engine.UnitTests (10)
BackEnd\SdkResolverService_Tests.cs (2)
728var man = new SdkResolverManifest(DisplayName: "TestResolversManifest", Path: null, ResolvableSdkRegex: new Regex("abc")); 804new Regex(pair.ResolvableSdkPattern, RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(500)));
Evaluation\ExpressionShredder_Tests.cs (4)
1206private static readonly Regex s_itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1211new Regex(@"^\s*(;\s*)*(" + 1227private static readonly Regex s_itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1236new 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)
19new("^xterm"), // xterm, PuTTY, Mintty 20new("^rxvt"), // RXVT 21new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 22new("^screen"), // GNU screen, tmux 23new("tmux"), // tmux 24new("^vt100"), // DEC VT series 25new("^vt102"), // DEC VT series 26new("^vt220"), // DEC VT series 27new("^vt320"), // DEC VT series 28new("ansi"), // ANSI 29new("scoansi"), // SCO ANSI 30new("cygwin"), // Cygwin, MinGW 31new("linux"), // Linux console 32new("konsole"), // Konsole 33new("bvterm"), // Bitvise SSH Client 34new("^st-256color"), // Suckless Simple Terminal, st 35new("alacritty"), // Alacritty
Microsoft.Build.Tasks.CodeAnalysis (7)
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 (16)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
27() => new Regex(
BootstrapperUtil\BuildMessage.cs (1)
18private static readonly Regex s_msbuildMessageCodePattern = new Regex(@"(\d+)$");
CanonicalError.cs (8)
56() => new Regex( 76() => new Regex( 82() => new Regex( 94() => new Regex( // Example: line 102() => new Regex( // Example: line-line 112() => new Regex( // Example: line,col 122() => new Regex( // Example: line,col-col 134() => new Regex( // Example: line,col,line,col
FileMatcher.cs (2)
1513regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2156matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
FindInvalidProjectReferences.cs (1)
24private static readonly Regex s_platformMonikerFormat = new Regex(
ManifestUtil\AssemblyIdentity.cs (1)
168Regex re = new Regex("^(?<name>[^,]*)(, Version=(?<version>[^,]*))?(, Culture=(?<culture>[^,]*))?(, PublicKeyToken=(?<pkt>[^,]*))?(, ProcessorArchitecture=(?<pa>[^,]*))?(, Type=(?<type>[^,]*))?");
NativeMethods.cs (1)
1248private static readonly Regex s_assemblyVersionRegex = new Regex(
ResolveSDKReference.cs (1)
40private static readonly Regex s_sdkReferenceFormat = new Regex(
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)
56() => new Regex( 76() => new Regex( 82() => new Regex( 94() => new Regex( // Example: line 102() => new Regex( // Example: line-line 112() => new Regex( // Example: line,col 122() => new Regex( // Example: line,col-col 134() => new Regex( // Example: line,col,line,col
CommandLineBuilder.cs (2)
158?? (_definitelyNeedQuotes = new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant)); 164?? (_allowedUnquoted = new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant));
FileMatcher.cs (2)
1513regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2156matchWithRegex ? 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.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)
146regex = 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 Regex(@"\[\|(?<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)
24private 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)
207new(
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( 28private static readonly Regex s_trackingStatementPattern = new(
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Extensions\ProtocolConversions.cs (1)
42private 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)
335var regex = new Regex(s_clientSideSectionPattern);
Microsoft.CodeAnalysis.Test.Utilities (6)
CompilationVerifier.cs (2)
201private static readonly Regex s_headerCommentsRegex = new("""^\s*// Header size: [0-9]+\s*$""", RegexOptions.Multiline); 202private 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.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (4)
CodeGen\CodeGenAsyncTests.vb (2)
9182Dim TypeNamePattern As New Regex("^VB\$StateMachine_(\d)+_(\w)+$", RegexOptions.Singleline) 9183Dim FieldPattern As New Regex("^((\$Builder)|(\$Stack)|(\$State)|(\$VB\$Me)|(\$A(\d)+)|(\$S(\d)+)|(\$I(\d)+)|(\$VB\$ResumableLocal_\$(\d)+)|(\$U(\d)+))$", RegexOptions.Singleline)
CodeGen\CodeGenVBCore.vb (2)
3152Private Shared ReadOnly s_normalizeRegex As New Regex("^(\s*)", RegexOptions.Multiline) 3213expected = New Regex("^" + indent, RegexOptions.Multiline).Replace(expected, "")
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
BasicTrackingDiagnosticAnalyzer.vb (1)
10Private Shared ReadOnly s_omittedSyntaxKindRegex As Regex = New Regex(
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
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)
432private 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.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 (2)
src\BuildModelFactory.cs (1)
79private readonly Regex LegacyRepositoryUriPattern = new Regex(
src\common\AzureConnectionStringBuildTask.cs (1)
39Regex storageConnectionStringRegex = new Regex("AccountName=(?<name>.+?);AccountKey=(?<key>.+?);");
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)
99Regex repositoryUriPattern = new Regex(@"^/(?<owner>[^/]+)/(?<repo>[^/]+)/?$");
Microsoft.DotNet.Helix.JobSender (3)
JobDefinition.cs (3)
210Regex illegalCharacters = new Regex("[^a-z0-9-]"); 211Regex multipleDashes = new Regex("-{2,}"); 283Match 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)
BaseDependenciesTask.cs (3)
83new Regex($@"<{elementName}>(?<{contentGroupName}>.*)</{elementName}>"); 86new Regex($@"""{msbuildSdkName}""\s*:\s*""(?<{contentGroupName}>.*)"""); 319updater.Regex = new Regex(manualRegex);
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.DotNet.XUnitAssert.Tests (6)
StringAssertsTests.cs (6)
379 Assert.DoesNotMatch(new Regex(@"\d"), "Hello"); 385 var ex = Record.Exception(() => Assert.DoesNotMatch(new Regex(@"ll"), "Hello, world!")); 790 Assert.Matches(new Regex(@"\w+"), "Hello"); 796 Assert.Matches(new Regex(@"[a-z]+", RegexOptions.IgnoreCase), "HELLO"); 802 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), "Hello, world!")); 816 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), null));
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.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 (2)
Model\SentencePieceTokenizer.cs (1)
90_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
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")
Microsoft.VisualStudio.LanguageServices.Test.Utilities2 (1)
UnifiedSettings\UnifiedSettingsTests.vb (1)
74Dim regexExp = New Regex("""CacheTag""=qword:\w{16}")
MSBuildTaskHost (17)
AnsiDetector.cs (17)
19new("^xterm"), // xterm, PuTTY, Mintty 20new("^rxvt"), // RXVT 21new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 22new("^screen"), // GNU screen, tmux 23new("tmux"), // tmux 24new("^vt100"), // DEC VT series 25new("^vt102"), // DEC VT series 26new("^vt220"), // DEC VT series 27new("^vt320"), // DEC VT series 28new("ansi"), // ANSI 29new("scoansi"), // SCO ANSI 30new("cygwin"), // Cygwin, MinGW 31new("linux"), // Linux console 32new("konsole"), // Konsole 33new("bvterm"), // Bitvise SSH Client 34new("^st-256color"), // Suckless Simple Terminal, st 35new("alacritty"), // Alacritty
PresentationBuildTasks (1)
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
1330private static Regex EscapedXmlEntities = new Regex("(<|>|\"|'|&)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
PresentationFramework (1)
MS\Internal\Globalization\BamlResourceContent.cs (1)
90private static Regex UnescapePattern = new Regex("(\\\\.?|&lt;|&gt;|&quot;|&apos;|&amp;)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
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)) });
SemanticSearch.BuildTask (2)
GenerateFilteredReferenceAssembliesTask.cs (2)
47private static readonly Regex s_lineSyntax = new(""" 193=> new("^" + string.Join(".*", pattern.Trim().Split('*').Select(Regex.Escape)) + "$",
SemanticSearch.BuildTask.UnitTests (8)
GenerateFilteredReferenceAssembliesTaskTests.cs (8)
116new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E.*"), IsIncluded: true), 117new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E`1"), IsIncluded: false)); 161new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 162new ApiPattern(SymbolKindFlags.Method, new Regex(@"I.M1"), IsIncluded: false)); 201new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 202new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.get_.*"), IsIncluded: false), 203new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.set_.*"), IsIncluded: false), 204new 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)
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
27private static readonly Regex _versionParser = new Regex(@"^(?<lb>[\(\[])?(?<range>\d+(-\d+)?)(?<hb>[\)\]])?$");
VisualBasicSyntaxGenerator (1)
Grammar\GrammarGenerator.vb (1)
349Private Shared ReadOnly s_normalizationRegex As New Regex(
xunit.assert (1)
Sdk\Exceptions\ExceptionUtility.cs (1)
25 static readonly Regex transformRegex = new Regex(@"^\s*at (?<method>.*) in (?<file>.*):(line )?(?<line>\d+)$");
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
23static readonly Regex RuntimeIdRegex = new Regex(@"(?<os>[A-Za-z0-9]+)(\.(?<version>[0-9\.]+))?(?<arch>\-[A-Za-z0-9]+)?(?<extra>\-[A-Za-z0-9]+)?");
919 references to Regex
AnalyzerRunner (1)
Options.cs (1)
162var expression = new Regex(arg.Substring("/editperf:".Length), RegexOptions.Compiled | RegexOptions.IgnoreCase);
Aspire.Dashboard (7)
Components\Layout\MobileNavMenu.razor.cs (2)
97private static Regex GetNonIndexPageRegex(string pageRelativeBasePath) 99pageRelativeBasePath = 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();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
Utils\FormatHelpers.cs (1)
31private static partial Regex MatchSecondsInTimeFormatPattern();
Aspire.Dashboard.Tests (2)
ConsoleLogsTests\UrlParserTests.cs (2)
91var regex = UrlParser.GenerateUrlRegEx(); 104var regex = UrlParser.GenerateUrlRegEx();
Aspire.EndToEnd.Tests (3)
tests\Shared\WorkloadTesting\AspireProject.cs (2)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled); 515private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting (4)
Dashboard\DashboardService.cs (1)
33private static partial Regex ApplicationNameRegex();
Dcp\DcpDependencyCheck.cs (1)
18private static partial Regex VersionRegex();
Dcp\Model\ModelCommon.cs (1)
227bool isValid = Regex.IsMatch(candidate, @"^[[a-zA-Z_~][a-zA-Z0-9\-._~]*$");
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
Aspire.Hosting.Azure.AppContainers (1)
AzureContainerAppsInfrastructure.cs (1)
906foreach (var match in Regex.EnumerateMatches(span, @"{\d+}"))
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
292Match match1 = Regex.Match(fileContents, pattern1); 294Match match2 = Regex.Match(fileContents, pattern2);
Aspire.Hosting.Tests (3)
DistributedApplicationTests.cs (2)
825var redisContainer = Assert.Single(list.Where(c => Regex.IsMatch(c.Name(),$"redis-{ReplicaIdRegex}-{suffix}"))) ; 831var otherRedisContainer = Assert.Single(list.Where(c => Regex.IsMatch(c.Name(), $"redisNoPort-{ReplicaIdRegex}-{suffix}")));
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.Workload.Tests (8)
AppHostTemplateTests.cs (1)
40private static partial Regex AppHostPackageReferenceRegex();
BuildAndRunTemplateTests.cs (1)
162private static partial Regex AppHostVersionRegex();
tests\Shared\WorkloadTesting\AspireProject.cs (2)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled); 515private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
WorkloadTestsBase.cs (3)
17private static partial Regex CommentLineRegex(); 21private static partial Regex GeneratedClassNameFixupRegex(); 228string[] matchedEndpoints = expectedEndpoints.Where(e => Regex.IsMatch(endpointFound, e)).ToArray();
BuildActionTelemetryTable (1)
Program.cs (1)
555var regex = new Regex(@"
BuildBoss (2)
CompilerNuGetCheckerUtil.cs (2)
101var regex = new Regex(@"^(.*?)\.\d.*\.nupkg$"); 429return Regex.IsMatch(fileName, regex);
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
40private static partial Regex BlankLinesInDocComment();
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1608private static partial Regex TimeSpanRegex();
dotnet-dev-certs (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
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>", ""));
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)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
71var 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)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var 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 (4)
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*)$");
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 (10)
UserJwtsTests.cs (10)
150var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 184var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 329var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 348var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 368var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 389var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 511var matches = Regex.Matches(_console.GetOutput(), "New JWT saved with ID '(.*?)'"); 604var printMatches = Regex.Matches(_console.GetOutput(), "Signing Key: '(.*?)'"); 609var resetMatches = Regex.Matches(_console.GetOutput(), "New signing key created: '(.*?)'"); 630var printMatches = Regex.Matches(_console.GetOutput(), "Signing Key: '(.*?)'");
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\LdapAdapter.cs (1)
18internal static partial Regex DistinguishedNameSeparator();
Microsoft.AspNetCore.Components (6)
src\Http\Routing\src\Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex GetAlphaRouteRegex();
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 (23)
EndpointHtmlRendererTest.cs (20)
60var match = Regex.Match(content, ComponentPattern); 83var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 126var match = Regex.Match(content, ComponentPattern); 163var match = Regex.Match(content, ComponentPattern); 198var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 247var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 306var match = Regex.Match(content, ComponentPattern); 338var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 399var firstMatch = Regex.Match(firstComponent, PrerenderedComponentPattern, RegexOptions.Multiline); 403var secondMatch = Regex.Match(secondComponent, ComponentPattern); 457var match = Regex.Match(content, ComponentPattern); 496var match = Regex.Match(content, ComponentPattern); 535var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 586var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 1064var serverMarkerMatch = Regex.Match(lines[0], PrerenderedComponentPattern); 1065var serverNonPrerenderedMarkerMatch = Regex.Match(lines[1], ComponentPattern); 1066var webAssemblyMarkerMatch = Regex.Match(lines[2], PrerenderedComponentPattern); 1067var webAssemblyNonPrerenderedMarkerMatch = Regex.Match(lines[3], ComponentPattern); 1167var numMarkers = Regex.Matches(content, MarkerPrefix).Count; 1170var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Singleline);
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 (1)
Circuits\ComponentHubTest.cs (1)
34mockClientProxy.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 (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
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)
51private 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); 60private 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)
51private 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); 60private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Http.Extensions.Tests (2)
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (2)
367newSource = Regex.Replace(newSource, _interceptsLocationAttributeRegex, "%INTERCEPTSLOCATIONATTRIBUTE%"); 394if (Regex.IsMatch(actualLine, _interceptsLocationAttributeRegex))
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 (7)
Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex GetAlphaRouteRegex();
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
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 (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
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 (72)
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)
29private static partial Regex GetSectionMatcherRegex(); 32private static partial Regex GetPropertyMatcherRegex();
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)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
55private static readonly Lazy<Regex> s_originCategoryCodeTextExpression = new Lazy<Regex>( 75private static readonly Lazy<Regex> s_originCategoryCodeTextExpression2 = new Lazy<Regex>( 81private static readonly Lazy<Regex> s_filenameLocationFromOrigin = new Lazy<Regex>( 93private static readonly Lazy<Regex> s_lineFromLocation = new Lazy<Regex>( 101private static readonly Lazy<Regex> s_lineLineFromLocation = new Lazy<Regex>( 111private static readonly Lazy<Regex> s_lineColFromLocation = new Lazy<Regex>( 121private static readonly Lazy<Regex> s_lineColColFromLocation = new Lazy<Regex>( 133private static readonly Lazy<Regex> s_lineColLineColFromLocation = new Lazy<Regex>(
Construction\ProjectRootElement.cs (2)
64private static readonly Lazy<Regex> XmlDeclarationRegEx = new Lazy<Regex>(() => new Regex(@"\A\s*\<\?\s*xml.*\?\>\s*\Z"), isThreadSafe: true);
Construction\Solution\SolutionFile.cs (4)
44private static readonly Lazy<Regex> s_crackProjectLine = new Lazy<Regex>( 62private static readonly Lazy<Regex> s_crackPropertyLine = new Lazy<Regex>(
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Definition\ToolsetReader.cs (2)
199var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander.cs (6)
3100internal static readonly Lazy<Regex> ItemMetadataPattern = new Lazy<Regex>( 3123internal static readonly Lazy<Regex> NonTransformItemMetadataPattern = new Lazy<Regex>( 4530else if (string.Equals(_methodMethodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 4534returnVal = Regex.Replace(arg1, arg2, arg3);
Evaluation\IntrinsicFunctions.cs (2)
40private static readonly Lazy<Regex> RegistrySdkRegex = new Lazy<Regex>(() => new Regex(@"^HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Microsoft SDKs\\Windows\\v(\d+\.\d+)$", RegexOptions.IgnoreCase));
FileMatcher.cs (5)
747Regex regexFileMatch, // can be null 770public Regex RegexFileMatch { get; } 1502out Regex regexFileMatch, 1837Regex regexFileMatch; 1859Regex 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 WeakValueDictionary<string, Regex> s_regexCache = new WeakValueDictionary<string, Regex>(); 57internal Regex TestOnlyRegex => _state.Value.Regex; 198Regex regex = null; 217Regex newRegex = new Regex(matchFileExpression, regexOptions);
ProjectWriter.cs (4)
45internal static readonly Lazy<Regex> itemVectorTransformPattern = new Lazy<Regex>( 61internal static readonly Lazy<Regex> itemVectorTransformRawPattern = new Lazy<Regex>(
Resources\Constants.cs (1)
362availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple<string, Type>(null, typeof(Regex)));
Utilities\EngineFileUtilities.cs (6)
25private static List<Regex> s_lazyWildCardExpansionRegexes; 537private static List<Regex> PopulateRegexFromEnvironment() 542return new List<Regex>(0); 546List<Regex> regexes = new List<Regex>(); 549Regex 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)
298private static readonly Regex s_xmlnsPattern = new Regex("xmlns=\"[^\"]*\"\\s*");
Microsoft.Build.BuildCheck.UnitTests (11)
EndToEndTests.cs (11)
63Regex.Matches(output, "BC0201: .* Property").Count.ShouldBe(2); 64Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 65Regex.Matches(output, "BC0203 .* Property").Count.ShouldBe(2); 128Regex.Matches(output.LogOutput, expectedDiagnostic).Count.ShouldBe(2); 216Regex regex = new Regex(@"(\d+) Warning\(s\)"); 242Regex.Matches(output, expectedDiagnostic).Count.ShouldBe(2); 352Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 353Regex.Matches(output, "BC0203: .* Property").Count.ShouldBe(38); 357Regex.Matches(output, "BC0202: .* Property").Count.ShouldBe(2); 358Regex.Matches(output, "BC0203: .* Property").Count.ShouldBe(42); 390Regex.Matches(output, expectedDiagnostic).Count.ShouldBe(2);
Microsoft.Build.CommandLine.UnitTests (1)
MSBuildServer_Tests.cs (1)
346Regex regex = new(@$"{toFind}(\d+)");
Microsoft.Build.Engine.OM.UnitTests (10)
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.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)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Microsoft.Build.Engine.UnitTests (17)
ConsoleLogger_Tests.cs (3)
693console.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>"); 697console.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>"); 704console.ToString().ShouldMatch($@"<{expectedColor}>{Regex.Escape(file)}\({lineNumber}\): {subcategory} {expectedMessageType} {code}: {message}{Environment.NewLine}<reset color>");
Definition\ToolsVersion_Tests.cs (1)
978return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern);
Evaluation\ExpressionShredder_Tests.cs (4)
1206private static readonly Regex s_itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1210private static readonly Regex s_listOfItemVectorsWithoutSeparatorsPattern = 1227private static readonly Regex s_itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1235private static readonly Regex s_nonTransformItemMetadataPattern =
FileMatcher_Tests.cs (1)
2569Regex 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)
788Regex.Matches(mockLogger.FullLog, $"{AssemblyMockCache}: GetCacheResultAsync for").Count.ShouldBe(graph.ProjectNodes.Count); 1643Regex.Matches(aString, substring).Count.ShouldBe(expectedOccurrences);
Microsoft.Build.Framework (2)
FileClassifier.cs (1)
157if (Regex.IsMatch(processName, $@".*\\MSBuild\\Current\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase))
Logging\AnsiDetector.cs (1)
17private static readonly Regex[] terminalsRegexes =
Microsoft.Build.Tasks.CodeAnalysis (7)
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 (32)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (2)
26private static readonly Lazy<Regex> s_crackAssemblyFoldersFromConfigSentinel = new Lazy<Regex>(
BootstrapperUtil\BuildMessage.cs (1)
18private static readonly Regex s_msbuildMessageCodePattern = new Regex(@"(\d+)$");
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
55private static readonly Lazy<Regex> s_originCategoryCodeTextExpression = new Lazy<Regex>( 75private static readonly Lazy<Regex> s_originCategoryCodeTextExpression2 = new Lazy<Regex>( 81private static readonly Lazy<Regex> s_filenameLocationFromOrigin = new Lazy<Regex>( 93private static readonly Lazy<Regex> s_lineFromLocation = new Lazy<Regex>( 101private static readonly Lazy<Regex> s_lineLineFromLocation = new Lazy<Regex>( 111private static readonly Lazy<Regex> s_lineColFromLocation = new Lazy<Regex>( 121private static readonly Lazy<Regex> s_lineColColFromLocation = new Lazy<Regex>( 133private static readonly Lazy<Regex> s_lineColLineColFromLocation = new Lazy<Regex>(
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Exec.cs (1)
422match = Regex.IsMatch(singleLine, regularExpression);
FileMatcher.cs (5)
747Regex regexFileMatch, // can be null 770public Regex RegexFileMatch { get; } 1502out Regex regexFileMatch, 1837Regex regexFileMatch; 1859Regex fileSpecRegex,
FindInvalidProjectReferences.cs (1)
24private static readonly Regex s_platformMonikerFormat = new Regex(
ManifestUtil\AssemblyIdentity.cs (1)
168Regex re = new Regex("^(?<name>[^,]*)(, Version=(?<version>[^,]*))?(, Culture=(?<culture>[^,]*))?(, PublicKeyToken=(?<pkt>[^,]*))?(, ProcessorArchitecture=(?<pa>[^,]*))?(, Type=(?<type>[^,]*))?");
NativeMethods.cs (1)
1248private static readonly Regex s_assemblyVersionRegex = new Regex(
ResolveSDKReference.cs (1)
40private static readonly Regex s_sdkReferenceFormat = new Regex(
Microsoft.Build.Tasks.UnitTests (5)
PortableTasks_Tests.cs (1)
80Regex.Matches(executionOutput, @"Microsoft\.Build\.(\w+\.)+dll").Count.ShouldBeGreaterThan(1);
ResourceHandling\GenerateResource_Tests.cs (3)
3769var matches = Regex.Matches(unformattedMessage, @"\{\d+.*?\}"); 3778sb.Append(Regex.Escape(segment)); 3785sb.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)
513if (Regex.IsMatch(file.Name, @"MSBuild_NodeShutdown_\d+\.txt") && 514Regex.IsMatch(contents, @"Node shutting down with reason BuildComplete and exception:\s*")) 522if (Regex.IsMatch(file.Name, @"MSBuild_CommTrace_PID_\d+\.txt"))
Microsoft.Build.Utilities.Core (29)
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
33directoryPath = Regex.Replace(directoryPath, "%VSINSTALLDIR%",
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
55private static readonly Lazy<Regex> s_originCategoryCodeTextExpression = new Lazy<Regex>( 75private static readonly Lazy<Regex> s_originCategoryCodeTextExpression2 = new Lazy<Regex>( 81private static readonly Lazy<Regex> s_filenameLocationFromOrigin = new Lazy<Regex>( 93private static readonly Lazy<Regex> s_lineFromLocation = new Lazy<Regex>( 101private static readonly Lazy<Regex> s_lineLineFromLocation = new Lazy<Regex>( 111private static readonly Lazy<Regex> s_lineColFromLocation = new Lazy<Regex>( 121private static readonly Lazy<Regex> s_lineColColFromLocation = new Lazy<Regex>( 133private static readonly Lazy<Regex> s_lineColLineColFromLocation = new Lazy<Regex>(
CommandLineBuilder.cs (4)
145private Regex _allowedUnquoted; 152private Regex _definitelyNeedQuotes; 157private Regex DefinitelyNeedQuotes => _definitelyNeedQuotes 163private Regex AllowedUnquoted => _allowedUnquoted
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
FileMatcher.cs (5)
747Regex regexFileMatch, // can be null 770public Regex RegexFileMatch { get; } 1502out Regex regexFileMatch, 1837Regex regexFileMatch; 1859Regex 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 (10)
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)); 245sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 355sb.Append(Regex.Escape(currentChar.ToString()));
Diagnostic\DiagnosticInfo.cs (1)
133var matches = Regex.Matches(message, @"\{\d+[}:]");
SourceGeneration\AdditionalSourcesCollection.cs (1)
27private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CodeStyle (12)
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,
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)
143Regex regex = null;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenReadOnlySpanConstructionTest.cs (2)
2572Match m = Regex.Match(il, @"\.data cil I_([0-9A-F]*) = bytearray"); 2689string[] 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)
1136Assert.All(Regex.Split(expected, "\r?\n"), line => Assert.False(HasTrailingWhitespace(line))); 1168var lines = Regex.Split(expected, "\r?\n"); 1198var lines = Regex.Split(expected, "\r?\n");
EnableNullable\EnableNullableTests.cs (2)
34if (!Regex.IsMatch(document.GetTextSynchronously(CancellationToken.None).ToString(), "#nullable ?enable")) 50if (!Regex.IsMatch(document.GetTextSynchronously(CancellationToken.None).ToString(), "#nullable ?restore"))
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Compilation\SemanticModelAPITests.cs (2)
4029for (var match = System.Text.RegularExpressions.Regex.Match(source, " => x"); match.Success; match = match.NextMatch()) 4057for (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 (4)
EditorConfigSettings\DataProvider\SettingsProviderBase.cs (1)
143var 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));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (4)
AutomaticCompletion\AbstractAutomaticLineEnderTests.cs (1)
60lines[i] = Regex.Replace(lines[i], "(?<=^( )*)( )", _ => "\t");
LanguageServer\AbstractLanguageServerProtocolTests.cs (2)
134var expectedWithoutWhitespace = Regex.Replace(expected, @"\s+", string.Empty); 135var actualWithoutWhitespace = Regex.Replace(actual, @"\s+", string.Empty);
Semantics\SpeculationAnalyzerTestsBase.cs (1)
19protected readonly Regex UnderTestRegex = new Regex(@"\[\|(?<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)
24private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); 116var 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)
206private static readonly Regex s_validNumberRegex =
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
36var regexType = compilation.GetTypeByMetadataName(typeof(Regex).FullName!); 48/// Finds public, static methods in <see cref="Regex"/> that have a parameter called 49/// 'pattern'. These are helpers (like <see cref="Regex.Replace(string, string, string)"/> 117if (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( 28private static readonly Regex s_trackingStatementPattern = new(
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\ProtocolConversions.cs (1)
42private 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 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)
335var regex = new Regex(s_clientSideSectionPattern);
Microsoft.CodeAnalysis.Test.Utilities (10)
CompilationVerifier.cs (3)
201private static readonly Regex s_headerCommentsRegex = new("""^\s*// Header size: [0-9]+\s*$""", RegexOptions.Multiline); 202private static readonly Regex s_codeSizeCommentsRegex = new("""^\s*// Code size(:) [0-9]+\s*""", RegexOptions.Multiline); 386actualMessage = 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) 523if (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.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (7)
CommandLineTests.vb (7)
555Dim patched As String = Regex.Replace(output.ToString().Trim(), "version \d+\.\d+\.\d+(-[\d\w]+)*", "version A.B.C-d") 580Return Regex.Replace(s, "(\((<developer build>|[a-fA-F0-9]{8})\))", "(HASH)") 596Dim patched As String = Regex.Replace(output.ToString().Trim(), "version \d+\.\d+\.\d+(-[\w\d]+)*", "version A.B.C-d") 5062Dim match = Regex.Match(output, pattern) 5364output = Regex.Replace(output, "^.*" & fileName, fileName, RegexOptions.Multiline) 5365output = Regex.Replace(output, "\r\n\s*\r\n", vbCrLf) ' empty strings 6481Dim actual = Regex.Replace(output, "^.*a.vb", "a.vb", RegexOptions.Multiline).Trim()
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
BasicTrackingDiagnosticAnalyzer.vb (1)
10Private Shared ReadOnly s_omittedSyntaxKindRegex As Regex = New Regex(
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (14)
Rename\RenameUtilities.cs (2)
252var regex = GetRegexForMatch(matchText); 289public static Regex GetRegexForMatch(string matchText)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
406var 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,
Workspace\Solution\ProjectInfo.cs (1)
432private 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.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 (6)
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)
79private readonly Regex LegacyRepositoryUriPattern = new Regex( 287string replacementUri = $"{Regex.Unescape(AzureDevOpsHostPattern)}/{m.Groups["account"].Value}";
src\common\AzureConnectionStringBuildTask.cs (1)
39Regex storageConnectionStringRegex = new Regex("AccountName=(?<name>.+?);AccountKey=(?<key>.+?);");
Microsoft.DotNet.Build.Tasks.Feed.Tests (1)
PublishArtifactsInManifestTests.cs (1)
66var 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.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)
99Regex repositoryUriPattern = new Regex(@"^/(?<owner>[^/]+)/(?<repo>[^/]+)/?$");
Microsoft.DotNet.Helix.JobSender (2)
JobDefinition.cs (2)
210Regex illegalCharacters = new Regex("[^a-z0-9-]"); 211Regex multipleDashes = new Regex("-{2,}");
Microsoft.DotNet.Helix.Sdk (3)
FindDotNetCliPackage.cs (1)
77return 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.Open.Api.Tools.Tests (8)
OpenApiAddFileTests.cs (4)
206var escapedPkgRef = Regex.Escape("<PackageReference Include=\"NSwag.ApiDescription.Client\" Version=\""); 207Assert.Single(Regex.Matches(content, escapedPkgRef)); 208var escapedApiRef = Regex.Escape($"<OpenApiReference Include=\"{nswagJsonFile}\""); 209Assert.Single(Regex.Matches(content, escapedApiRef));
OpenApiAddURLTests.cs (4)
411var escapedPkgRef = Regex.Escape("<PackageReference Include=\"NSwag.ApiDescription.Client\" Version=\""); 412Assert.Single(Regex.Matches(content, escapedPkgRef)); 413var escapedApiRef = Regex.Escape($"SourceUrl=\"{FakeOpenApiUrl}\""); 414Assert.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)
160Regex[] ignoreUsageRegexes = baseline.IgnorePatterns.NullAsEmpty()
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.VersionTools (2)
Dependencies\FileRegexUpdater.cs (2)
16public Regex Regex { get; set; } 66Regex regex,
Microsoft.DotNet.VersionTools.Tasks (3)
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.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.DotNet.XUnitAssert.Tests (2)
StringAssertsTests.cs (2)
373 Assert.Throws<ArgumentNullException>("expectedRegex", () => Assert.DoesNotMatch((Regex?)null!, "Hello, world!")); 784 Assert.Throws<ArgumentNullException>("expectedRegex", () => Assert.Matches((Regex?)null!, "Hello, world!"));
Microsoft.Extensions.AI (1)
Functions\AIFunctionFactory.Utilities.cs (1)
28private static partial Regex InvalidNameCharsRegex();
Microsoft.Extensions.AI.Integration.Tests (2)
ChatClientIntegrationTests.cs (1)
264Regex.IsMatch(response.Message.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase),
VerbatimHttpHandler.cs (1)
37Regex.Replace(text, @"\s*", string.Empty);
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
184DateTimeOffset[] createdAts = Regex.Matches(Output, @"2024.*?Z").Cast<Match>().Select(m => DateTimeOffset.Parse(m.Value)).ToArray();
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (1)
87var suppliedSchemaMatch = Regex.Match(messages[1].Text!, "```(.*?)```", RegexOptions.Singleline);
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.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.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 (3)
WebView\WebView.cs (3)
299 var singleQuotes = Regex.Matches(js, @"(\\*?)'"); 321 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 (26)
Model\SentencePieceTokenizer.cs (2)
35private readonly Regex? _specialTokensRegex; 90_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Model\TiktokenTokenizer.cs (8)
1116private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1118private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1179private static partial Regex Cl100kBaseRegex(); 1182internal static partial Regex P50kBaseRegex(); 1185internal static partial Regex O200kBaseRegex(); 1209(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1369(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1409(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
PreTokenizer\PreTokenizer.cs (8)
32internal static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex) 50private static partial Regex WhiteSpaceOrPunctuationRegex(); 79private static partial Regex WordOrNonWordRegex(); 109private static partial Regex WhiteSpaceRegex(); 133internal static IEnumerable<(int Offset, int Length)> SplitText(ReadOnlySpan<char> text, Regex regex) 140static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, int textLength) 157internal static bool TryGetMatch(Regex regex, string text, int beginning, int length, out (int offset, int length) match) 178internal static bool TryGetMatch(Regex regex, scoped ReadOnlySpan<char> text, int beginning, int length, out (int offset, int length) match)
PreTokenizer\RegexPreTokenizer.cs (8)
18private readonly Regex? _specialTokensRegex; 19private readonly Regex _regex; 27public RegexPreTokenizer(Regex regex, IReadOnlyDictionary<string, int>? specialTokens) 39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 57static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex, Regex? specialTokensRegex) 108static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, Regex? specialTokensRegex, int textLength)
Microsoft.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
MSBuild (5)
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
TerminalLogger\TerminalLogger.cs (1)
43private static partial Regex ImmediateMessageRegex();
XMake.cs (1)
2257responseFileLine = Regex.Replace(responseFileLine, responseFilePathReplacement,
MSBuildTaskHost (3)
AnsiDetector.cs (1)
17private static readonly Regex[] terminalsRegexes =
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Mvc.RoutingWebSite (1)
TestParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromSeconds(10)).ToLowerInvariant();
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)
1330private static Regex EscapedXmlEntities = new Regex("(<|>|\"|'|&)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
PresentationFramework (2)
MS\Internal\Globalization\BamlResourceContent.cs (1)
90private static Regex UnescapePattern = new Regex("(\\\\.?|&lt;|&gt;|&quot;|&apos;|&amp;)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
System\Windows\Documents\WinRTSpellerInterop.cs (1)
567string[] matches = Regex.Split(line.Trim(), regexPattern, regexOptions);
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)
360if (Regex.IsMatch(name, pattern.Trim('\'', '"'))) 373if (Regex.IsMatch(name, pattern.Trim('\'', '"'))) 386TestRuntime.Core => Regex.IsMatch(dirName, @"^net\d+\."),
SemanticSearch.BuildTask (4)
GenerateFilteredReferenceAssembliesTask.cs (4)
26Regex MetadataNamePattern, 47private static readonly Regex s_lineSyntax = new(""" 192internal static Regex ParseApiPattern(string pattern) 193=> 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 (1)
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 (12)
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 (11)
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) 185foreach (Regex r in regexBypassList)
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\Globals.cs (1)
350public static partial Regex FullSRSInternalsVisibleRegex { get; }
System.Private.Xml (15)
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)
2683private static partial Regex EnsureArrayIndexRegex { get; } 2686private 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 (2)
System\Text\Json\JsonHelpers.cs (2)
319public static readonly Regex IntegerRegex = CreateIntegerRegex(); 325private 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)
99/// The enumerator has no public constructor. The <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/> method returns a <see cref="Regex.ValueMatchEnumerator"/> 108private readonly Regex _regex; 117/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 120internal ValueMatchEnumerator(Regex regex, ReadOnlySpan<char> input, int startAt)
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (3)
178private readonly Regex _regex; 189/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 194internal 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) 113_ilg!.Emit(OpCodes.Call, typeof(Regex).GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, Array.Empty<ParameterModifier>())!); 116Stfld(RegexField(nameof(Regex.pattern))); 119Stfld(RegexField(nameof(Regex.roptions))); 122Stfld(RegexField(nameof(Regex.factory))); 126if (matchTimeout == Regex.InfiniteMatchTimeout) 129_ilg.Emit(OpCodes.Ldsfld, RegexField(nameof(Regex.InfiniteMatchTimeout))); 137Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 142Stfld(RegexField(nameof(Regex.capsize))); 146GenerateCreateHashtable(RegexField(nameof(Regex.caps)), tree.CaptureNumberSparseMapping); 151GenerateCreateHashtable(RegexField(nameof(Regex.capnames)), tree.CaptureNameToNumberMapping); 162FieldInfo capslistField = RegexField(nameof(Regex.capslist)); 185Call(typeof(Regex).GetMethod(nameof(Regex.ValidateMatchTimeout), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!); 188Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 226typeof(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 (2)
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 (2)
System\ComponentModel\Design\DesignerActionItem.cs (1)
27private static partial Regex SanitizeNameRegex();
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2244private static partial Regex ParenthesisRegex();
System.Windows.Forms.Tests (1)
System\Windows\Forms\NativeToWinFormsAdapterTests.cs (1)
17private static partial Regex PlaceholdersPattern();
TagHelpersWebSite (1)
TagHelpers\AutoLinkerTagHelper.cs (1)
17output.Content.AppendHtml(Regex.Replace(
TaskUsageLogger (1)
TaskUsageLogger.cs (1)
47private static readonly Regex s_msbuildPropertyRegex = new Regex(@"[\$][\(](?<name>.*?)[\)]", RegexOptions.ExplicitCapture);
Templates.Blazor.Tests (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
Templates.Blazor.WebAssembly.Auth.Tests (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
Templates.Blazor.WebAssembly.Tests (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
Templates.Mvc.Tests (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
Templates.Tests (7)
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 (5)
779private static partial Regex OpenSslVersionRegex(); 861private static partial Regex OpenSslHashFilenameRegex(); 868private static partial Regex OpenSslCertificateExtensionRegex(); 880var hashRegex = OpenSslHashFilenameRegex(); 881var extensionRegex = OpenSslCertificateExtensionRegex();
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 (5)
Sdk\Exceptions\ExceptionUtility.cs (1)
25 static readonly Regex transformRegex = new Regex(@"^\s*at (?<method>.*) in (?<file>.*):(line )?(?<line>\d+)$");
StringAsserts.cs (4)
539 var match = Regex.Match(actualString, expectedRegexPattern); 558 Regex expectedRegex, 1364 if (actualString == null || !Regex.IsMatch(actualString, expectedRegexPattern)) 1375 Regex expectedRegex,
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
23static readonly Regex RuntimeIdRegex = new Regex(@"(?<os>[A-Za-z0-9]+)(\.(?<version>[0-9\.]+))?(?<arch>\-[A-Za-z0-9]+)?(?<extra>\-[A-Za-z0-9]+)?");