106 types derived from Regex
cdac-build-tool (2)
_generated\0\RegexGenerator.g.cs (2)
62file sealed class FindTemplatePlaceholderRegex_0 : Regex 204file sealed class CStringEscape_1 : Regex
dotnet (2)
_generated\190\RegexGenerator.g.cs (2)
74file sealed class GetFrameRegex_0 : Regex 453file sealed class GetInvalidJsonBackslashRegex_1 : Regex
dotnet-aot (2)
_generated\116\RegexGenerator.g.cs (2)
74file sealed class GetFrameRegex_0 : Regex 453file sealed class GetInvalidJsonBackslashRegex_1 : Regex
dotnet-dev-certs (3)
_generated\10\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
illink (2)
Microsoft.AspNetCore.Authentication.Negotiate (1)
_generated\1\RegexGenerator.g.cs (1)
40file sealed class DistinguishedNameSeparatorRegex_0 : Regex
Microsoft.AspNetCore.Components (1)
_generated\7\RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
_generated\0\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Microsoft.AspNetCore.Routing (1)
_generated\1\RegexGenerator.g.cs (1)
39file sealed class AlphaRouteRegex_0 : Regex
Microsoft.AspNetCore.Server.Kestrel.Core (3)
_generated\1\RegexGenerator.g.cs (3)
89file sealed class OpenSslVersionRegex_0 : Regex 250file sealed class OpenSslHashFilenameRegex_1 : Regex 383file sealed class OpenSslCertificateExtensionRegex_2 : Regex
Microsoft.Build (21)
_generated\10\RegexGenerator.g.cs (21)
847file sealed class OriginCategoryCodeTextExpression_0 : Regex 1700file sealed class OriginCategoryCodeTextExpression2_1 : Regex 2058file sealed class FilenameLocationFromOrigin_2 : Regex 2355file sealed class LineFromLocation_3 : Regex 2477file sealed class LineLineFromLocation_4 : Regex 2632file sealed class LineColFromLocation_5 : Regex 2787file sealed class LineColColFromLocation_6 : Regex 2971file sealed class LineColLineColFromLocation_7 : Regex 3184file sealed class SectionMatcherRegex_8 : Regex 3599file sealed class PropertyMatcherRegex_9 : Regex 4043file sealed class TerminalLoggerArgPattern_10 : Regex 4345file sealed class VerbosityArgPattern_11 : Regex 4590file sealed class TerminalLoggerParametersArgPattern_12 : Regex 4828file sealed class ConsoleLoggerParametersArgPattern_13 : Regex 5066file sealed class ItemVectorTransformRegex_14 : Regex 5460file sealed class ItemVectorTransformRawRegex_15 : Regex 5772file sealed class XmlDeclarationRegex_16 : Regex 5980file sealed class CrackProjectLineRegex_17 : Regex 6450file sealed class CrackPropertyLineRegex_18 : Regex 6717file sealed class RegistrySdkRegex_19 : Regex 6888file sealed class XmlnsPattern_20 : Regex
Microsoft.Build.Framework (1)
_generated\1\RegexGenerator.g.cs (1)
53file sealed class CommandLineNodeModeRegex_0 : Regex
Microsoft.Build.Tasks.Core (13)
_generated\0\RegexGenerator.g.cs (13)
465file sealed class OriginCategoryCodeTextExpression_0 : Regex 1318file sealed class OriginCategoryCodeTextExpression2_1 : Regex 1676file sealed class FilenameLocationFromOrigin_2 : Regex 1973file sealed class LineFromLocation_3 : Regex 2095file sealed class LineLineFromLocation_4 : Regex 2250file sealed class LineColFromLocation_5 : Regex 2405file sealed class LineColColFromLocation_6 : Regex 2589file sealed class LineColLineColFromLocation_7 : Regex 2802file sealed class MsbuildMessageCodePattern_8 : Regex 2920file sealed class PlatformMonikerRegex_9 : Regex 3088file sealed class AssemblyNameRegex_10 : Regex 3793file sealed class AssemblyVersionRegex_11 : Regex 3991file sealed class SdkReferenceFormatRegex_12 : Regex
Microsoft.Build.Utilities.Core (8)
_generated\0\RegexGenerator.g.cs (8)
306file sealed class OriginCategoryCodeTextExpression_0 : Regex 1159file sealed class OriginCategoryCodeTextExpression2_1 : Regex 1517file sealed class FilenameLocationFromOrigin_2 : Regex 1814file sealed class LineFromLocation_3 : Regex 1936file sealed class LineLineFromLocation_4 : Regex 2091file sealed class LineColFromLocation_5 : Regex 2246file sealed class LineColColFromLocation_6 : Regex 2430file sealed class LineColLineColFromLocation_7 : Regex
Microsoft.CodeAnalysis (2)
_generated\0\RegexGenerator.g.cs (2)
85file sealed class GetSectionMatcherRegex_0 : Regex 500file sealed class GetPropertyMatcherRegex_1 : Regex
Microsoft.DotNet.Cli.Definitions (1)
_generated\6\RegexGenerator.g.cs (1)
107file sealed class TimeoutPattern_0 : Regex
Microsoft.DotNet.HotReload.Watch (3)
_generated\0\RegexGenerator.g.cs (3)
92file sealed class GetNowListeningOnRegex_0 : Regex 297file sealed class GetAspireDashboardUrlRegex_1 : Regex 502file sealed class GetBuildDiagnosticRegex_2 : Regex
Microsoft.Extensions.AI.OpenAI (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (1)
37file sealed class InvalidAuthorNameRegex_0 : Regex
Microsoft.ML.Tokenizers (6)
RegexGenerator.g.cs (6)
229file sealed class Cl100kBaseRegex_0 : Regex 679file sealed class P50kBaseRegex_1 : Regex 1053file sealed class O200kBaseRegex_2 : Regex 1888file sealed class WhiteSpaceOrPunctuationRegex_3 : Regex 2018file sealed class WordOrNonWordRegex_4 : Regex 2151file sealed class WhiteSpaceRegex_5 : Regex
Microsoft.NET.Build.Containers (1)
_generated\0\RegexGenerator.g.cs (1)
44file sealed class BearerParameterSplitter_0 : Regex
RepoTasks (3)
_generated\0\RegexGenerator.g.cs (3)
88file sealed class OpenSslVersionRegex_0 : Regex 248file sealed class OpenSslHashFilenameRegex_1 : Regex 380file sealed class OpenSslCertificateExtensionRegex_2 : Regex
System.ComponentModel.TypeConverter (1)
_generated\0\RegexGenerator.g.cs (1)
39file sealed class ParameterReplacementRegex_0 : Regex
System.Data.Common (3)
_generated\0\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Data.Odbc (3)
_generated\1\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Data.OleDb (3)
_generated\4\RegexGenerator.g.cs (3)
88file sealed class ConnectionStringValidKeyRegex_0 : Regex 275file sealed class ConnectionStringQuoteValueRegex_1 : Regex 376file sealed class ConnectionStringQuoteOdbcValueRegex_2 : Regex
System.Private.DataContractSerialization (1)
_generated\0\RegexGenerator.g.cs (1)
193file sealed class FullSRSInternalsVisibleRegex_0 : Regex
System.Private.Xml (12)
_generated\0\RegexGenerator.g.cs (12)
305file sealed class DecodeCharRegex_0 : Regex 438file sealed class EncodeCharRegex_1 : Regex 597file sealed class LanguageRegex_2 : Regex 781file sealed class Regex1_3 : Regex 1071file sealed class Regex2_4 : Regex 1250file sealed class EnsureArrayIndexRegex_5 : Regex 1595file sealed class P0Regex_6 : Regex 1800file sealed class UnknownNodeNullAnyTypeRegex_7 : Regex 1938file sealed class UnknownNodeObjectEmptyRegex_8 : Regex 2111file sealed class UnknownNodeObjectNullRegex_9 : Regex 2255file sealed class UnknownNodeObjectRegex_10 : Regex 2399file sealed class ParamsReadRegex_11 : Regex
System.Text.Json (1)
_generated\0\RegexGenerator.g.cs (1)
42file sealed class IntegerRegex_0 : Regex
System.Windows.Forms (1)
_generated\2\RegexGenerator.g.cs (1)
37file sealed class ContiguousNonWhitespace_0 : Regex
System.Windows.Forms.Design (1)
_generated\2\RegexGenerator.g.cs (1)
58file sealed class SanitizeNameRegex_0 : Regex
376 instantiations of Regex
Aspire.Acquisition.Tests (1)
Scripts\LocalHiveScriptFunctionTests.cs (1)
31var userEnvironmentWrite = new System.Text.RegularExpressions.Regex(
Aspire.Cli.EndToEnd.Tests (2)
Helpers\CliE2ETestHelpers.cs (2)
30private static readonly Regex s_commitShaPattern = new("^[0-9a-fA-F]{40}$", RegexOptions.Compiled); 1083var stablePackageRegex = new Regex(@"^Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase);
Aspire.Dashboard (2)
Components\Layout\MobileNavMenu.razor.cs (2)
203return new Regex($"^({pageRelativeBasePath}(\\?.*)?|{pageRelativeBasePath}/.+)$", LinkMatchRegexOptions); 209return new Regex($"^{pageRelativeBasePath}(\\?.*)?$", LinkMatchRegexOptions);
Aspire.Dashboard.Tests (4)
Integration\Playwright\DashboardInteractionsTests.cs (3)
103await Assertions.Expect(buttons).ToHaveClassAsync(new Regex(@"\bis-active\b")); 105await Assertions.Expect(bottomButton).ToHaveClassAsync(new Regex(@"\bis-visible\b")); 125await Assertions.Expect(bottomButton).Not.ToHaveClassAsync(new Regex(@"\bis-visible\b"));
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting.CodeGeneration.TypeScript.Tests (6)
AtsTypeScriptCodeGeneratorTests.cs (6)
1285new(@"\b(?:interface|class|type)\s+(\w*Promise(?:Impl)?)\b", RegexOptions.Compiled); 1290new(@"\b[A-Z]\w*Promise(?:Impl)?\b", RegexOptions.Compiled); 1293new(@"\b(?:interface|enum|type)\s+([A-Z]\w*)\b", RegexOptions.Compiled); 1296new(@"\b[A-Z]\w*\b", RegexOptions.Compiled); 1409new( 1417new(@"invokeCapability<(\w+)>\([^;]*?\);\s*return new (\w+)\(", RegexOptions.Compiled);
Aspire.Hosting.Foundry (2)
FoundryLocalService.cs (2)
20private static readonly Regex s_urlRegex = new(@"https?://\S+", RegexOptions.Compiled); 21private static readonly Regex s_progressRegex = new(@"(?<progress>\d+(?:\.\d+)?)\s*%", RegexOptions.Compiled);
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
28private static readonly Regex s_exportIdPattern = new(
Aspire.Hosting.Kubernetes.Tests (4)
KubernetesIngressTests.cs (1)
122new System.Text.RegularExpressions.Regex(@"parameters:\s*[\r\n]+\s*public:\s*[\r\n]+\s*" + System.Text.RegularExpressions.Regex.Escape(parameterName) + @"\s*:"),
KubernetesPublisherTests.cs (3)
1995var parametersBlockRegex = new System.Text.RegularExpressions.Regex( 2000new System.Text.RegularExpressions.Regex(@"parameters:[\s\S]+data:[\s\S]+" + 2004new System.Text.RegularExpressions.Regex(@"parameters:[\s\S]+data:[\s\S]+" +
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
52var regex = new Regex(wait.Pattern);
Aspire.Templates.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet (34)
Commands\Test\MTP\Terminal\AnsiDetector.cs (17)
20new("^xterm"), // xterm, PuTTY, Mintty 21new("^rxvt"), // RXVT 22new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 23new("^screen"), // GNU screen, tmux 24new("tmux"), // tmux 25new("^vt100"), // DEC VT series 26new("^vt102"), // DEC VT series 27new("^vt220"), // DEC VT series 28new("^vt320"), // DEC VT series 29new("ansi"), // ANSI 30new("scoansi"), // SCO ANSI 31new("cygwin"), // Cygwin, MinGW 32new("linux"), // Linux console 33new("konsole"), // Konsole 34new("bvterm"), // Bitvise SSH Client 35new("^st-256color"), // Suckless Simple Terminal, st 36new("alacritty"), // Alacritty
Commands\Test\VSTest\TestCommand.cs (17)
689new("^xterm"), // xterm, PuTTY, Mintty 690new("^rxvt"), // RXVT 691new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 692new("^screen"), // GNU screen, tmux 693new("tmux"), // tmux 694new("^vt100"), // DEC VT series 695new("^vt102"), // DEC VT series 696new("^vt220"), // DEC VT series 697new("^vt320"), // DEC VT series 698new("ansi"), // ANSI 699new("scoansi"), // SCO ANSI 700new("cygwin"), // Cygwin, MinGW 701new("linux"), // Linux console 702new("konsole"), // Konsole 703new("bvterm"), // Bitvise SSH Client 704new("^st-256color"), // Suckless Simple Terminal, st 705new("alacritty"), // Alacritty
dotnet-aot (17)
src\sdk\src\Cli\dotnet\Commands\Test\MTP\Terminal\AnsiDetector.cs (17)
20new("^xterm"), // xterm, PuTTY, Mintty 21new("^rxvt"), // RXVT 22new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 23new("^screen"), // GNU screen, tmux 24new("tmux"), // tmux 25new("^vt100"), // DEC VT series 26new("^vt102"), // DEC VT series 27new("^vt220"), // DEC VT series 28new("^vt320"), // DEC VT series 29new("ansi"), // ANSI 30new("scoansi"), // SCO ANSI 31new("cygwin"), // Cygwin, MinGW 32new("linux"), // Linux console 33new("konsole"), // Konsole 34new("bvterm"), // Bitvise SSH Client 35new("^st-256color"), // Suckless Simple Terminal, st 36new("alacritty"), // Alacritty
dotnet-svcutil-lib (10)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
557new Regex(@"(^(.*)(\(([0-9]+),([0-9]+)\)): )(error|warning) ([A-Z]+[0-9]+) ?: (.*)"); 559new Regex(@"(error|warning) ([A-Z]+[0-9]+) ?: (.*)");
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (1)
543s_outputReg = new Regex(@"^([^(]*)\(?([0-9]*)\)? ?:? ?(error|warning) ([A-Z]+[0-9]+) ?: ((.|\n)*)");
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (2)
366_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString()), RegexOptions.None)); 1361Regex langRegex = new Regex("^([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*$", RegexOptions.None);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
75regex = new Regex(pattern);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
103s_decodeCharPattern = new Regex("_[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); 212s_encodeCharPattern = new Regex("(?<=_)[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_");
ILCompiler.Compiler (1)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
ILCompiler.ReadyToRun (1)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (1)
250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
illink (1)
Infrastructure.Tests (3)
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (2)
29private static readonly Regex s_standaloneLiteral = new( 36private static readonly Regex s_anyPartitionTrait = new(
TestTriggerMap\TestTriggerMapTests.cs (1)
625var usesLocalAction = new System.Text.RegularExpressions.Regex(
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (1)
29_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
Microsoft.AspNetCore.Components (1)
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
DebugProxyLauncher.cs (3)
19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
52private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 61private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Rewrite (9)
ApacheModRewrite\RuleBuilder.cs (4)
68match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout), input.Invert); 72match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout), input.Invert); 165_match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout), input.Invert); 169_match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout), input.Invert);
IISUrlRewrite\UriMatchCondition.cs (1)
27var regex = new Regex(
IISUrlRewrite\UrlRewriteRuleBuilder.cs (2)
49var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout); 54var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
RedirectRule.cs (1)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
RewriteRule.cs (1)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
Microsoft.AspNetCore.Routing (1)
Constraints\RegexRouteConstraint.cs (1)
53_regexFactory = () => new Regex(
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.SpaServices.Extensions (4)
AngularCli\AngularCliBuilder.cs (1)
70new Regex("Date", RegexOptions.None, RegexMatchTimeout));
AngularCli\AngularCliMiddleware.cs (1)
77new Regex("open your browser on (http\\S+)", RegexOptions.None, RegexMatchTimeout));
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
ReactDevelopmentServer\ReactDevelopmentServerMiddleware.cs (1)
91new Regex("Starting the development server", RegexOptions.None, RegexMatchTimeout));
Microsoft.Build (5)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
129manifest.ResolvableSdkRegex = new Regex(pattern, regexOptions, TimeSpan.FromMilliseconds(SdkResolverPatternRegexTimeoutMsc));
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
Definition\ToolsetReader.cs (1)
207var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Globbing\MSBuildGlob.cs (1)
228Regex newRegex = new Regex(matchFileExpression, regexOptions);
Utilities\EngineFileUtilities.cs (1)
582Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Microsoft.Build.Framework (23)
Globbing\MSBuildPathMatcher.cs (3)
146? new Regex( 628return new Regex(expression.ToString(), GetRegexOptions(ignoreCase, useInvariantCulture)); 665return new Regex(expression.ToString(), GetRegexOptions(ignoreCase: true, useInvariantCulture));
Logging\AnsiDetector.cs (17)
18new("^xterm"), // xterm, PuTTY, Mintty 19new("^rxvt"), // RXVT 20new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 21new("^screen"), // GNU screen, tmux 22new("tmux"), // tmux 23new("^vt100"), // DEC VT series 24new("^vt102"), // DEC VT series 25new("^vt220"), // DEC VT series 26new("^vt320"), // DEC VT series 27new("ansi"), // ANSI 28new("scoansi"), // SCO ANSI 29new("cygwin"), // Cygwin, MinGW 30new("linux"), // Linux console 31new("konsole"), // Konsole 32new("bvterm"), // Bitvise SSH Client 33new("^st-256color"), // Suckless Simple Terminal, st 34new("alacritty"), // Alacritty
Telemetry\CrashTelemetry.cs (1)
171private static readonly Regex FilePathPattern = new(
Utilities\FileMatcher.cs (2)
1633regexFileMatch = new Regex(matchFileExpression, CaseInsensitiveRegexOptions); 2321? new Regex(
Microsoft.Build.Tasks.CodeAnalysis (7)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (7)
54private static readonly Regex s_originCategoryCodeTextExpression = new Regex 76private static readonly Regex s_filenameLocationFromOrigin = new Regex(@" 88private static readonly Regex s_lineFromLocation = new Regex(@" 96private static readonly Regex s_lineLineFromLocation = new Regex(@" 106private static readonly Regex s_lineColFromLocation = new Regex(@" 116private static readonly Regex s_lineColColFromLocation = new Regex(@" 128private static readonly Regex s_lineColLineColFromLocation = new Regex(@"
Microsoft.Build.Tasks.Core (1)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
27() => new Regex(
Microsoft.Build.Utilities.Core (2)
CommandLineBuilder.cs (2)
158new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant); 164new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
127var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled));
SourceGeneration\AdditionalSourcesCollection.cs (1)
28private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
250public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 252public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 254public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.CodeAnalysis.Features (9)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr); 640else if (relativePath.IsEmpty() && new Regex(fileName).IsMatch(relativePath))
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (1)
28_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})(?!\w)((\s*,\s*)(?<option>[a-z]+))*",
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
208new(
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.NetAnalyzers (2)
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (2)
49private static readonly Regex s_AntiForgeryAttributeRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute$", RegexOptions.Compiled); 50private static readonly Regex s_AntiForgeryRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*$", RegexOptions.Compiled);
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
AbstractResxGenerator.cs (2)
864private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 865private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (4)
PatternMatching\RegexPatternMatcher.cs (2)
44var caseInsensitive = new Regex(pattern, commonOptions | RegexOptions.IgnoreCase, timeout); 45var caseSensitive = new Regex(pattern, commonOptions, timeout);
Rename\RenameUtilities.cs (1)
330return new Regex(matchString, RegexOptions.CultureInvariant);
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (3)
TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.Data.Analysis.Tests (3)
src\Microsoft.Data.Analysis\TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (1)
34_patterns[i] = (new Regex(rawPatterns[i].CaptureGroupPattern, RegexOptions.Compiled), rawPatterns[i].ReplacementString);
Microsoft.DotNet.Arcade.Sdk (2)
src\GenerateResxSource.cs (2)
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.Manifest (1)
BuildModelFactory.cs (1)
62private readonly Regex LegacyRepositoryUriPattern = new Regex(
Microsoft.DotNet.Build.Tasks.Installers (3)
src\CreateWixBuildWixpack.cs (2)
230var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>"); 642var regex = new Regex(@"<\?include\s+([^\s\?>]+)\s*\?>", RegexOptions.IgnoreCase);
src\GenerateCurrentVersion.cs (1)
98Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.HotReload.Utils.Generator (1)
EditAndContinueCapabilitiesParser.cs (1)
12static public readonly Regex capabilitiesTokenizer = new (@"^\s*(?:(\S+)\s+)*(\S+)?$", RegexOptions.CultureInvariant);
Microsoft.DotNet.ProjectTools (2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\UsagePattern.cs (3)
30return new Regex(IdentityRegex, RegexOptions.IgnoreCase | RegexOptions.Compiled); 38return new Regex( 43return new Regex("");
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.Extensions.AI.Abstractions (4)
ChatCompletion\ChatResponseFormat.cs (1)
101private static readonly Regex _invalidNameCharsRegex = new("[^0-9A-Za-z_]", RegexOptions.Compiled);
Functions\AIFunctionFactory.cs (3)
1294private static readonly Regex _potentiallyJsonRegex = new(PotentiallyJsonRegexString, RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled); 1338private static readonly Regex _compilerGeneratedNameRegex = new(@"^<([^>]+)>\w__(.+)", RegexOptions.Compiled); 1348private static readonly Regex _invalidNameCharsRegex = new("[^0-9A-Za-z]+", RegexOptions.Compiled);
Microsoft.Extensions.AI.Evaluation (2)
Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Console (2)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Reporting (2)
parent\parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Safety (2)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.Configuration.Binder.SourceGeneration (1)
Emitter\CoreBindingHelpers.cs (1)
21private static readonly Regex s_arrayBracketsRegex = new(Regex.Escape("[]"));
Microsoft.Extensions.Http.Diagnostics (1)
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
23public static Regex MakeRouteRegex() => new(RouteRegexString, RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor (2)
Parser_2.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports (2)
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Maui.Controls (1)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
13 = new Regex(@"^[a-z]([a-z0-9_]*[a-z0-9])?$", RegexOptions.Singleline | RegexOptions.Compiled);
Microsoft.ML.Core (1)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
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 (5)
Model\SentencePieceBaseModel.cs (2)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 97SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Normalizer\SentencePieceNormalizationStep.cs (1)
444return new ReplaceStep(literal: null, new Regex(regexPattern, RegexOptions.CultureInvariant, _regexTimeout), content);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Microsoft.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
1057preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
Microsoft.NET.Build.Containers (16)
ContainerHelpers.cs (1)
37private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
DigestUtils.cs (1)
30["sha256"] = new Regex(@"^[a-f0-9]{64}$"),
ImageBuilder.cs (1)
29internal static Regex aspnetPortRegex = new(@"(?<scheme>\w+)://(?<domain>([*+]|).+):(?<port>\d+)");
ReferenceParser.cs (13)
98public static readonly Regex DomainRegexp = new(domain); 104public static readonly Regex AnchoredDomainRegexp = new(anchored(domain)); 114public static readonly Regex TagRegexp = new(tag); 126public static readonly Regex anchoredTagRegexp = new(anchoredTag); 172public static readonly Regex DigestRegexp = new(digestPat); 182public static readonly Regex AnchoredDigestRegexp = new(anchored( 203public static readonly Regex NameRegexp = new(namePat); 218public static readonly Regex anchoredNameRegexp = new(anchoredName); 236public static readonly Regex ReferenceRegexp = new(referencePat); 250public static readonly Regex IdentifierRegexp = new(identifier); 264public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 276private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 290private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier);
Microsoft.NET.Sdk.Publish.Tasks (2)
MsDeploy\VsMSDeployObject.cs (1)
189RegularExpressions.Regex match = new(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase);
WebConfigTelemetry.cs (1)
14() => new Regex
Microsoft.NET.Sdk.StaticWebAssets.Tasks (5)
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
ScopedCss\RewriteCss.cs (1)
27private static readonly Regex s_deepCombinatorRegex = new($@"^{DeepCombinatorText}\s*", RegexOptions.None, s_regexTimeout);
UpdateExternallyDefinedStaticWebAssets.cs (1)
198var regex = new Regex(pattern, regexOptions);
Microsoft.TemplateEngine.Cli (1)
TemplateInvoker.cs (1)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (1)
Mount\Archive\ZipFileDirectory.cs (1)
25Regex r = new Regex($"^{rx}$");
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (2)
ValueForms\KebabCaseValueFormFactory.cs (1)
21Regex pattern = new(@"(?:\p{Lu}\p{M}*)?(?:\p{Ll}\p{M}*)+|(?:\p{Lu}\p{M}*)+(?!\p{Ll})|\p{N}+|[^\p{C}\p{P}\p{Z}]+|[\u2700-\u27BF]");
ValueForms\ReplacementValueFormFactory.cs (1)
39return new ReplacementValueFormSettings(new Regex(jObject.ToString("pattern")), jObject.ToString("replacement"));
Microsoft.TemplateEngine.Utils (3)
InMemoryFileSystem.cs (3)
196Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 276Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 358Regex rx = new("^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$");
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\TimeSpanParser.cs (1)
11static readonly Regex Pattern = new(@"(?<value>^\d+(?:\.\d+)?)\s*(?<suffix>ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase);
Microsoft.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.TestPlatform.Common (2)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpressionWrapper.cs (1)
82FastFilter.PropertyValueRegex = new Regex(regexString, RegexOptions.Compiled);
Utilities\RunSettingsProviderExtensions.cs (1)
100Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
44private static readonly Regex InvalidXmlCharsRegex = new(
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.VisualStudio.TestPlatform.ObjectModel (1)
DataCollector\Common\FileHelper.cs (1)
15private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.Web.XmlTransform (4)
XmlElementContext.cs (1)
300nameAndArgumentsRegex = new Regex(@"\A\s*(?<name>\w+)(\s*\((?<arguments>.*)\))?\s*\Z", RegexOptions.Compiled|RegexOptions.Singleline);
XmlTransforms.cs (3)
312s_dirRegex = new RegularExpressions.Regex(@"\G\{%(\s*(?<attrname>\w+(?=\W))(\s*(?<equal>=)\s*'(?<attrval>[^']*)'|\s*(?<equal>=)\s*(?<attrval>[^\s%>]*)|(?<equal>)(?<attrval>\s*?)))*\s*?%\}"); 324s_parentAttribRegex = new RegularExpressions.Regex(@"\G\$\((?<tagname>[\w:\.]+)\)"); 336s_tokenFormatRegex = new RegularExpressions.Regex(@"\G\#\((?<tagname>[\w:\.]+)\)");
NuGet.Common (1)
PathUtil\PathResolver.cs (1)
99return new Regex('^' + pattern + '$', RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant);
NuGet.Configuration (1)
Proxy\WebProxy.cs (1)
84.Select(x => new Regex(x, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
NuGet.Packaging (4)
Licenses\LicenseExpressionTokenizer.cs (1)
13private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
Licenses\NuGetLicense.cs (1)
89var regex = new Regex("^[a-zA-Z0-9\\.\\-]+$", RegexOptions.CultureInvariant);
PackageCreation\Utility\PackageIdValidator.cs (1)
18private static readonly Regex IdRegex = new Regex(pattern: @"^\w+([.-]\w+)*$",
Signing\Content\KeyPairFileReader.cs (1)
14private static readonly Regex NamePattern = new Regex("^[a-zA-Z0-9\\.\\-/]+$", RegexOptions.CultureInvariant);
QuarantineTools.Tests (6)
ActiveIssueTests.cs (2)
184Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[ActiveIssue", RegexOptions.Multiline), norm); 186Assert.Matches(new Regex(@"\[Fact\]\n\s+\[ActiveIssue\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
QuarantineScriptTests.cs (4)
196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline); 217Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[QuarantinedTest", RegexOptions.Multiline), norm); 219Assert.Matches(new Regex(@"\[Fact\]\n\s+\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
sdk-tasks (2)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
ZipFileCreateFromDirectory.cs (1)
70regexes[i] = new Regex(ExcludePatterns[i].ItemSpec, RegexOptions.IgnoreCase);
SelectTests (1)
ChangedFileFilter.cs (1)
133return new Regex("^" + sb + "$", RegexOptions.CultureInvariant);
SuperFileCheck (2)
Program.cs (2)
79var regex = new System.Text.RegularExpressions.Regex(pattern); 90var invalidRegex = new System.Text.RegularExpressions.Regex(invalidFullLinePattern);
System.ComponentModel.Annotations (2)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (2)
121? new Regex(Pattern) 122: new Regex(Pattern, default(RegexOptions), TimeSpan.FromMilliseconds(MatchTimeoutInMilliseconds));
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
18_regex = new Regex(regex, RegexOptions.Compiled);
System.Data.Common (1)
System\Data\Common\DBCommandBuilder.cs (1)
47_parameterNameParser = new Regex(_dbCommandBuilder.ParameterNamePattern!, RegexOptions.ExplicitCapture | RegexOptions.Singleline);
System.DirectoryServices.AccountManagement (1)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (1)
337regex = new Regex(SAMUtils.PAPIQueryToRegexString(wildcardFilter), RegexOptions.Singleline);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
341regexBypassList[i] = new Regex((string)bypassList[i]!, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
System.Private.Xml (1)
System\Xml\Schema\FacetChecker.cs (1)
367_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString())));
System.Text.RegularExpressions (9)
System\Text\RegularExpressions\Regex.Cache.cs (2)
145regex = new Regex(pattern, culture); 164regex = new Regex(pattern, options, matchTimeout, culture);
System\Text\RegularExpressions\Regex.Match.cs (4)
199/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval 329/// <see cref="Regex"/> object with the <see cref="Regex(string, RegexOptions)"/> constructor and calling 367/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and calling the instance 415/// <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor. If you do not set a time-out interval
System\Text\RegularExpressions\Regex.Timeout.cs (2)
36/// The <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor and a number of static matching 87/// object by calling the <see cref="Regex(string, RegexOptions, TimeSpan)"/> constructor; and you can
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
48Regex whitespaceRegex = new(@"\s");
vstest.console (1)
Internal\MSBuildLogger.cs (1)
511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
vstest.console.arm64 (1)
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (1)
511s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
1715 references to Regex
aspire (59)
Acquisition\InstallationDiscovery.cs (1)
406private static partial Regex PrChannelVersionRegex();
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
289var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, maxRegexTimeout); 308var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, maxRegexTimeout);
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
921private static partial Regex OpenSslVersionRegex { get; } 997private static partial Regex OpenSslHashFilenameRegex { get; } 1004private static partial Regex OpenSslCertificateExtensionRegex { get; }
Certificates\CertificateHelpers.cs (1)
157internal static partial Regex OpenSslVersionRegex();
Commands\NewCommand.cs (2)
817internal static partial Regex GetProjectNameRegex(); 826var regex = GetProjectNameRegex();
Commands\PipelineCommandBase.cs (1)
702return System.Text.RegularExpressions.Regex.Replace(text, @"\[/?[^\]]*\]", "");
Documentation\ApiDocs\ApiDocsIndexService.cs (1)
1146private static partial Regex TokenSplitRegex();
Documentation\ApiDocs\ApiDocsSourceConfiguration.cs (1)
231private static partial Regex LocalMarkdownLinkRegex();
Documentation\ApiDocs\ApiMemberMarkdownParser.cs (1)
149private static partial Regex MemberOverviewRegex();
Documentation\Docs\DocsIndexService.cs (18)
1011private static string ReplaceIfMatches(string input, Regex regex, string replacement) 1052private static partial Regex TokenSplitRegex(); 1056private static partial Regex CodeBlockRegex(); 1060private static partial Regex IdentifierRegex(); 1063private static partial Regex MarkdownFenceBlockRegex(); 1066private static partial Regex InlineHeadingRegex(); 1069private static partial Regex SectionTitledBookmarkRegex(); 1072private static partial Regex InlineOrderedListRegex(); 1075private static partial Regex InlineUnorderedListRegex(); 1078private static partial Regex InlineTableStartRegex(); 1081private static partial Regex InlineTableRowBoundaryRegex(); 1084private static partial Regex InlineTableEndRegex(); 1087private static partial Regex TrailingWhitespaceBeforeNewlineRegex(); 1090private static partial Regex ExcessBlankLinesRegex(); 1093private static partial Regex LeadingWhitespaceRegex(); 1096private static partial Regex BlankLineAfterHeadingRegex(); 1099private static partial Regex BlankLineAfterTableRegex(); 1102private static partial Regex BlankLineAfterListRegex();
Documentation\Docs\DocsSourceConfiguration.cs (1)
117private static partial Regex MarkdownLinkRegex();
Documentation\LexicalScoring.cs (1)
36public static string[] Tokenize(string text, Regex tokenSplitRegex, int minTokenLength)
Projects\DotNetAppHostProject.cs (1)
1247private static partial Regex WalkUpFunctionCallStartRegex();
Projects\FallbackProjectParser.cs (2)
22private static partial Regex SdkDirectiveRegex(); 25private static partial Regex PackageDirectiveRegex();
Projects\LegacyTypeScriptAppHost.cs (1)
185private static partial Regex LegacyAppHostFileNameRegex();
Projects\PrebuiltAppHostServer.cs (1)
595private static partial Regex FloatingVersionAttributeRegex();
Projects\ProjectUpdater.cs (2)
896internal static partial Regex SdkDirectiveRegex(); 903internal static partial Regex LegacyAppHostPackageDirectiveRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ConsoleLogs\UrlParser.cs (2)
14private static readonly Regex s_urlRegEx = GenerateUrlRegEx(); 73public static partial Regex GenerateUrlRegEx();
src\Shared\ContainerRuntimeDetector.cs (1)
407var match = Regex.Match(output, @"[Vv]ersion\s*:?\s*(\d+\.\d+(?:\.\d+)?)", RegexOptions.IgnoreCase);
src\Shared\DateFormatStringsHelpers.cs (4)
24private static partial Regex MatchSecondsInTimeFormatPattern(); 28private static partial Regex MatchHourIn24HourTimeFormatPattern(); 32private static partial Regex MatchHourIn12HourTimeFormatPattern(); 36private static partial Regex MatchAmPmDesignator();
Telemetry\InternalMicrosoftDetector.cs (3)
1321private static partial Regex GitHubTokenRegex(); 1324private static partial Regex JwtRegex(); 1327private static partial Regex MicrosoftAccountRegex();
Templating\ConditionalBlockProcessor.cs (1)
46private static partial Regex LeftoverMarkerPattern();
Utils\ConsoleActivityLogger.cs (1)
841return Regex.Replace(
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (4)
244private static partial Regex Wsl1KernelRelease(); 255private static partial Regex Wsl2KernelRelease(); 259private static partial Regex KernelRelease(); 265private static partial Regex NumericKernelRelease();
Utils\Markdown\MarkdownLinkConverter.cs (1)
29private static partial Regex LinkRegex();
Utils\Markdown\MarkdownToSpectreConverter.cs (1)
358private static partial Regex HtmlTagRegex();
Aspire.Acquisition.Tests (5)
Scripts\LocalHiveScriptFunctionTests.cs (1)
31var userEnvironmentWrite = new System.Text.RegularExpressions.Regex(
Scripts\PRScriptInstallerModeTests.cs (1)
444var m = System.Text.RegularExpressions.Regex.Match(line, @"^\s*-?\s*RelativeFilePath:\s*(\S+)\s*$");
Scripts\PRScriptPowerShellTests.cs (1)
57var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Scripts\PRScriptToolModeTests.cs (1)
728var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Scripts\ReleaseScriptPowerShellTests.cs (1)
85var normalized = System.Text.RegularExpressions.Regex.Replace(result.Output, @"\r?\n\s*", "");
Aspire.Azure.Storage.Blobs (1)
AzureBlobStorageContainerSettings.cs (1)
16private static partial Regex ContainerNameRegex();
Aspire.Azure.Storage.Files.DataLake (1)
AzureDataLakeFileSystemSettings.cs (1)
16private static partial Regex FileSystemNameRegex();
Aspire.Azure.Storage.Queues (1)
AzureStorageQueueSettings.cs (1)
16private static partial Regex QueueNameRegex();
Aspire.Cli.EndToEnd.Tests (17)
CentralPackageManagementTests.cs (1)
204var sdkMatch = System.Text.RegularExpressions.Regex.Match(
EmulatedLocalReleaseBuildTests.cs (3)
319var match = Regex.Match(content, "Sdk=\"Aspire\\.AppHost\\.Sdk/(?<version>[^\"]+)\""); 338var match = Regex.Match(content, "Include=\"(?<id>Aspire\\.[^\"]*Redis[^\"]*)\"\\s+Version=\"(?<version>[^\"]+)\""); 341match = Regex.Match(content, "Version=\"(?<version>[^\"]+)\"\\s+Include=\"(?<id>Aspire\\.[^\"]*Redis[^\"]*)\"");
EmulatedReleasedBuildTests.cs (1)
232var match = Regex.Match(content, "Sdk=\"Aspire\\.AppHost\\.Sdk/(?<version>[^\"]+)\"");
EmulatedStagingBuildTests.cs (1)
296var match = Regex.Match(content, "Sdk=\"Aspire\\.AppHost\\.Sdk/(?<version>[^\"]+)\"");
Helpers\CliE2ETestHelpers.cs (5)
30private static readonly Regex s_commitShaPattern = new("^[0-9a-fA-F]{40}$", RegexOptions.Compiled); 737var branchMatch = Regex.Match(version, @"^(?<major>\d+)\.(?<minor>\d+)\."); 801var match = Regex.Match(finalUrl, @"aspire-cli-[^/]+?-(?<version>\d+\.\d+\.\d+(?:-[0-9A-Za-z.]+)?)\.tar\.gz", RegexOptions.IgnoreCase); 1025.Where(static fileName => fileName is not null && Regex.IsMatch(fileName, @"^Aspire\.Hosting\.\d+\.\d+\.\d+.*\.nupkg$", RegexOptions.IgnoreCase)) 1083var stablePackageRegex = new Regex(@"^Aspire\.Hosting\.(?<version>\d+\.\d+\.\d+)\.nupkg$", RegexOptions.IgnoreCase);
McpDocsE2ETests.cs (1)
314private static partial Regex SlugRegex();
SmokeTests.cs (1)
190var match = Regex.Match(appHostContent, @"(?m)^#:\s*sdk\s+Aspire\.AppHost\.Sdk@(?<version>\S+)\s*$");
tests\Shared\CliInstallStrategy.cs (1)
138if (!Regex.IsMatch(sha, @"^[0-9a-fA-F]{7,40}$") && sha != "main")
tests\Shared\CliPackageDiscovery.cs (2)
97private static partial Regex VersionPattern(); 100private static partial Regex RidSpecificPackagePattern();
TypeScriptCodegenValidationTests.cs (1)
182if (Regex.IsMatch(initialAspireTs, @"(?m)^\s*(?![*/])\S.*\baddRedis\s*\("))
Aspire.Cli.Tests (11)
Commands\PipelineCommandListStepsTests.cs (1)
16private static partial Regex AnsiEscapeRegex();
Mcp\E2E\McpDocsE2ETests.cs (1)
310private static partial Regex SlugRegex();
Mcp\ListConsoleLogsToolTests.cs (1)
450var match = Regex.Match(text, @"```plaintext\s*(.*?)\s*```", RegexOptions.Singleline);
Npm\AspireJsLauncherTests.cs (2)
187var supportedRidsMatch = Regex.Match(scriptContent, @"\$supportedRids\s*=\s*@\((?<rids>[^)]*)\)", RegexOptions.Singleline); 190return Regex.Matches(supportedRidsMatch.Groups["rids"].Value, @"'(?<rid>[^']+)'")
Projects\ProjectUpdaterTests.cs (2)
3275var regex = ProjectUpdater.SdkDirectiveRegex(); 3294var regex = ProjectUpdater.LegacyAppHostPackageDirectiveRegex();
Utils\MarkdownToSpectreConverterTests.cs (1)
740private static partial Regex AnsiEscapeRegex();
Utils\TerminalLinkAssert.cs (3)
13output = Regex.Replace(output, @"\x1b\[[0-9;]*m", string.Empty); 18var escapedLink = Regex.Escape(link); 20var matches = Regex.Matches(output, segmentPattern, RegexOptions.Singleline);
Aspire.Confluent.Kafka.Tests (1)
KafkaContainerFixture.cs (1)
86private static partial Regex KafkaReadyRegex();
Aspire.Dashboard (16)
Components\Layout\MobileNavMenu.razor.cs (4)
200private static Regex GetNonIndexPageRegex(string pageRelativeBasePath) 202pageRelativeBasePath = Regex.Escape(pageRelativeBasePath); 206private static Regex GetIndexPageRegex(string pageRelativeBasePath) 208pageRelativeBasePath = Regex.Escape(pageRelativeBasePath);
Components\Layout\MobileNavMenuEntry.cs (1)
14Regex? LinkMatchRegex = null);
Model\ConnectionStringParser.cs (2)
62private static partial Regex HostPortRegex(); 69private static partial Regex JdbcUrlRegex();
Model\ResourceOutgoingPeerResolver.cs (1)
24private static partial Regex HostRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ConsoleLogs\UrlParser.cs (2)
14private static readonly Regex s_urlRegEx = GenerateUrlRegEx(); 73public static partial Regex GenerateUrlRegEx();
src\Shared\DateFormatStringsHelpers.cs (4)
24private static partial Regex MatchSecondsInTimeFormatPattern(); 28private static partial Regex MatchHourIn24HourTimeFormatPattern(); 32private static partial Regex MatchHourIn12HourTimeFormatPattern(); 36private static partial Regex MatchAmPmDesignator();
src\Shared\InteractionHelpers.cs (1)
22private static partial Regex NonAlphanumericRegex();
Aspire.Dashboard.Tests (6)
ConsoleLogsTests\UrlParserTests.cs (2)
101var regex = UrlParser.GenerateUrlRegEx(); 114var regex = UrlParser.GenerateUrlRegEx();
Markdown\MarkdownProcessorTests.cs (3)
43var count = Regex.Matches(html, Regex.Escape("code-block")).Count; 171var title = Regex.Match(html, "<div class=\"code-title\">(.*?)</div>").Groups[1].Value;
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.Deployment.EndToEnd.Tests (3)
tests\Shared\CliInstallStrategy.cs (1)
138if (!Regex.IsMatch(sha, @"^[0-9a-fA-F]{7,40}$") && sha != "main")
tests\Shared\CliPackageDiscovery.cs (2)
97private static partial Regex VersionPattern(); 100private static partial Regex RidSpecificPackagePattern();
Aspire.EndToEnd.Tests (3)
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled); 565private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting (10)
Dashboard\DashboardService.cs (1)
44private static partial Regex ApplicationNameRegex();
Dcp\DcpDependencyCheck.cs (1)
20private static partial Regex VersionRegex();
Dcp\DcpExecutor.cs (1)
48private static partial Regex ApplicationNameRegex();
Dcp\Model\ModelCommon.cs (1)
246bool isValid = Regex.IsMatch(candidate, @"^[[a-zA-Z_~][a-zA-Z0-9\-._~]*$");
Pipelines\Internal\FileDeploymentStateManager.cs (1)
41private static partial Regex ValidEnvironmentNameRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\ContainerRuntimeDetector.cs (1)
407var match = Regex.Match(output, @"[Vv]ersion\s*:?\s*(\d+\.\d+(?:\.\d+)?)", RegexOptions.IgnoreCase);
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
src\Shared\InteractionHelpers.cs (1)
22private static partial Regex NonAlphanumericRegex();
Utils\ContainerReferenceParser.cs (1)
40private static partial Regex ImageNameRegex();
Aspire.Hosting.Azure (1)
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
60private static partial Regex ResourceGroupValidCharacters();
Aspire.Hosting.Azure.KeyVault (1)
AzureKeyVaultResourceExtensions.cs (1)
401private static partial Regex AzureKeyVaultSecretNameRegex();
Aspire.Hosting.Azure.Kubernetes (1)
AzureKubernetesEnvironmentResource.AksPipeline.cs (1)
860private static partial Regex AzureResourceNamePattern();
Aspire.Hosting.Azure.Tests (3)
AzureContainerAppsTests.cs (1)
2340var match = System.Text.RegularExpressions.Regex.Match(
AzureResourcePreparerTests.cs (1)
652var roleAssignmentCount = System.Text.RegularExpressions.Regex.Matches(manifest.BicepText, "Microsoft.Authorization/roleAssignments@").Count;
AzureSqlPrincipalReconciliationTests.cs (1)
204var match = Regex.Match(
Aspire.Hosting.CodeGeneration.Java.Tests (5)
AtsJavaCodeGeneratorTests.cs (5)
72Assert.Empty(Regex.Matches(generated, @"\bDouble\b(?!\.)")); 409.Where(kvp => Regex.IsMatch(kvp.Value, @"^import\s+[\w.]+\.\*;", RegexOptions.Multiline)) 430foreach (Match import in Regex.Matches(content, @"^import\s+(?:static\s+)?([\w.]+)\.(\w+);", RegexOptions.Multiline)) 435if (!Regex.IsMatch(body, $@"\b{Regex.Escape(simpleName)}\b"))
Aspire.Hosting.CodeGeneration.TypeScript (1)
TypeScriptApiProjector.cs (1)
1124private static partial Regex DeclaredTypeNameRegex();
Aspire.Hosting.CodeGeneration.TypeScript.Tests (9)
AtsTypeScriptCodeGeneratorTests.cs (9)
1284private static readonly Regex s_promiseDeclarationPattern = 1289private static readonly Regex s_promiseReferencePattern = 1292private static readonly Regex s_apiDeclarationPattern = 1295private static readonly Regex s_apiTypeReferencePattern = 1303Regex.Replace(Regex.Replace(typeScript, @"/\*.*?\*/", string.Empty, RegexOptions.Singleline), @"//[^\n]*", string.Empty); 1309Regex.Replace( 1408private static readonly Regex s_implementationConstructorPattern = 1416private static readonly Regex s_rpcHandleConstructionPattern =
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (2)
961private static partial Regex TunnelIdRegex(); 964private static partial Regex LabelRegex();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.Docker.Tests (1)
DockerComposePublisherTests.cs (1)
837.ScrubLinesWithReplace(line => Regex.Replace(line, @"aspire-deploy-\d{14}", "aspire-deploy-TIMESTAMP"));
Aspire.Hosting.Foundry (3)
FoundryLocalService.cs (2)
20private static readonly Regex s_urlRegex = new(@"https?://\S+", RegexOptions.Compiled); 21private static readonly Regex s_progressRegex = new(@"(?<progress>\d+(?:\.\d+)?)\s*%", RegexOptions.Compiled);
HostedAgent\HostedAgentConfiguration.cs (1)
209private static partial Regex EnvironmentVariableNameRegex();
Aspire.Hosting.Go (2)
GoVersionDetector.cs (2)
57private static partial Regex ToolchainDirectiveRegex(); 61private static partial Regex GoDirectiveRegex();
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
28private static readonly Regex s_exportIdPattern = new(
Aspire.Hosting.Java (7)
JavaDockerfileGenerator.cs (2)
1311private static partial Regex GradleDistributionRegex(); 1314private static partial Regex MavenDistributionRegex();
JavaHostingExtensions.cs (1)
2088private static partial Regex GradleRootProjectNameRegex();
JavaVersionDetector.cs (4)
255private static Match? FirstActiveMatch(Regex regex, GradleScript script) 438private static partial Regex ToolchainRegex(); 442private static partial Regex JavaVersionEnumRegex(); 446private static partial Regex CompatibilityRegex();
Aspire.Hosting.JavaScript (1)
JavaScriptHostingExtensions.cs (1)
2117private static partial Regex PnpmVersionRegex();
Aspire.Hosting.Kubernetes (13)
Deployment\HelmDeploymentEngine.cs (2)
111private static partial Regex DnsLabelPattern(); 411private static partial Regex HelmValuesExpressionRegex();
Deployment\HelmVersionValidator.cs (1)
42private static partial Regex HelmVersionRegex();
Extensions\HelmExtensions.cs (6)
142internal static partial Regex HelmFlowControlPattern(); 145private static partial Regex HelmFlowControlExpressionPattern(); 148private static partial Regex QuotedTemplateExpressionPattern(); 151internal static partial Regex EndWithNonStringTypePattern(); 154internal static partial Regex ScalarExpressionPattern(); 157internal static partial Regex ExpressionPattern();
HelmChartOptions.cs (2)
330private static partial Regex DnsLabelPattern(); 333private static partial Regex HelmChartNamePattern();
KubernetesHelmChartExtensions.cs (2)
500private static partial Regex ChartReferencePattern(); 506private static partial Regex HelmSetKeyPattern();
Aspire.Hosting.Kubernetes.Tests (5)
KubernetesIngressTests.cs (1)
122new System.Text.RegularExpressions.Regex(@"parameters:\s*[\r\n]+\s*public:\s*[\r\n]+\s*" + System.Text.RegularExpressions.Regex.Escape(parameterName) + @"\s*:"),
KubernetesPublisherTests.cs (4)
1995var parametersBlockRegex = new System.Text.RegularExpressions.Regex( 1997System.Text.RegularExpressions.Regex.Escape(storageClassName) + @"\s*:"); 2001System.Text.RegularExpressions.Regex.Escape(capacityName) + @"\s*:"), 2005System.Text.RegularExpressions.Regex.Escape(backupTierName) + @"\s*:"),
Aspire.Hosting.Maui (1)
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.MySql.Tests (2)
AddMySqlTests.cs (2)
285Match match1 = Regex.Match(fileContents, pattern1); 287Match match2 = Regex.Match(fileContents, pattern2);
Aspire.Hosting.Python (2)
PythonVersionDetector.cs (2)
113private static partial Regex RequiresPythonRegex(); 116private static partial Regex PythonVersionOutputRegex();
Aspire.Hosting.Radius (5)
CloudProviders\CloudProviderValidation.cs (2)
50private static partial Regex AwsAccountIdPattern(); 60private static partial Regex IamRoleArnPattern();
Publishing\BicepPostProcessor.cs (2)
138private static partial Regex RecipePackWithoutProperties(); 413private static partial Regex InvalidIdentifierChars();
RadiusExtensions.cs (1)
104private static partial Regex DnsLabelPattern();
Aspire.Hosting.Redis.Tests (1)
AddRedisTests.cs (1)
994var match = Regex.Match(valueExpression, @"\{(cond-[^.]+)\.connectionString\}");
Aspire.Hosting.RemoteHost (7)
Ats\CapabilityDispatcher.cs (1)
734var match = Regex.Match(message, @"type '([^']+)'.*(?:to|into) type '([^']+)'");
Ats\PolyglotCapabilityInvocationException.cs (6)
521message = Regex.Replace( 523$@"\b{Regex.Escape(clrMemberName)}\b", 534message = Regex.Replace( 536$@"\b{Regex.Escape(alias.Key)}\b", 592private static partial Regex DoubleWhitespaceRegex(); 595private static partial Regex ControlCharacterRegex();
Aspire.Hosting.Rust (3)
CargoMetadataReader.cs (1)
215private static partial Regex SensitiveEnvironmentVariableNamePattern();
RustDockerfileGenerator.cs (2)
357private static partial Regex SensitiveCargoConfigAssignmentPattern(); 362private static partial Regex CredentialBearingUrlPattern();
Aspire.Hosting.Rust.Tests (3)
AddRustAppPublishTests.cs (1)
1078var match = Regex.Match(
RustDockerfileSnapshotScrubber.cs (1)
27private static partial Regex TargetCacheIdPattern();
RustReadmeTests.cs (1)
19var links = Regex.Matches(additionalDocumentation, @"https://[^\s)]+")
Aspire.Hosting.Sdk.Tests (2)
AppHostSdkTargetsTests.cs (2)
1691? $"/D /V:OFF /C {Regex.Replace(aspireCliPath, """[ \t()[\]{}!^`<>&|;,+="~@]""", "^$0")} " 1722var escapedCliPath = Regex.Replace(cliPath, """[ \t()[\]{}!^`<>&|;,+="~@]""", "^$0");
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
23internal static partial Regex GoStatements();
Aspire.Hosting.Tasks (1)
ResolveAspireCliBundle.cs (1)
449var sourceMatch = Regex.Match(sidecar, @"""source""\s*:\s*""(?<source>[^""]*)""");
Aspire.Hosting.Tests (6)
DistributedApplicationTests.cs (4)
1857var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1876var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}")); 1935var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1955var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}"));
ProjectResourceTests.cs (1)
933.ScrubLinesWithReplace(s => Regex.Replace(s, "FROM projectname:temp-.*", "FROM projectname:temp-"));
WaitForTests.cs (1)
580Assert.Contains(logs, log => Regex.IsMatch(log.Message, @"(?i).*resource.*nginx.*failed.*"));
Aspire.Hosting.TestUtilities (3)
Helpers\KubernetesHelper.cs (1)
34if (Regex.IsMatch(name, resourceNamePattern) && ready(r))
Utils\ContainerRuntimeLogPatterns.cs (2)
92private static partial Regex PodmanImagePullFailureRegex(); 95private static partial Regex PodmanBuildStepRegex();
Aspire.Playground.Tests (2)
AppHostTests.cs (1)
52var regex = new Regex(wait.Pattern);
ProjectSpecificTests.cs (1)
87output = Regex.Replace(output, pattern: @"(?<=http:\/\/127\.0\.0\.1:)\d+", replacement: "*");
Aspire.Templates.Tests (10)
AppHostTemplateTests.cs (1)
39private static partial Regex AppHostPackageReferenceRegex();
BuildAndRunTemplateTests.cs (3)
243private static partial Regex AppHostVersionRegex(); 246private static partial Regex ProjectClosingTagRegex(); 249private static partial Regex ProjectSdkVersionRegex();
LocalhostTldHostnameTests.cs (1)
13private static partial Regex HostnamePattern();
TemplateTestsBase.cs (2)
17private static partial Regex CommentLineRegex(); 21private static partial Regex GeneratedClassNameFixupRegex();
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login URL:\s+(?<url>.*)", RegexOptions.Compiled); 565private static partial Regex TargetFrameworkPropertyRegex();
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.TestTools (1)
GitHubCli.cs (1)
380var fileName = Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
cdac-build-tool (14)
_generated\0\RegexGenerator.g.cs (12)
23private static partial global::System.Text.RegularExpressions.Regex FindTemplatePlaceholderRegex => global::System.Text.RegularExpressions.Generated.FindTemplatePlaceholderRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex CStringEscape => global::System.Text.RegularExpressions.Generated.CStringEscape_1.Instance; 59/// <summary>Custom <see cref="Regex"/>-derived type for the FindTemplatePlaceholderRegex method.</summary> 78/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 81/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 201/// <summary>Custom <see cref="Regex"/>-derived type for the CStringEscape method.</summary> 220/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 223/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 317/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 321/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 322internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 325internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
ContractDescriptorSourceFileEmitter.cs (2)
27private static partial Regex FindTemplatePlaceholderRegex { get; } 78private static partial Regex CStringEscape { get; }
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
40private static partial Regex BlankLinesInDocComment();
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
1611private static partial Regex TimeSpanRegex();
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet (17)
_generated\190\RegexGenerator.g.cs (12)
34private static partial global::System.Text.RegularExpressions.Regex GetFrameRegex() => global::System.Text.RegularExpressions.Generated.GetFrameRegex_0.Instance; 55private static partial global::System.Text.RegularExpressions.Regex GetInvalidJsonBackslashRegex() => global::System.Text.RegularExpressions.Generated.GetInvalidJsonBackslashRegex_1.Instance; 71/// <summary>Custom <see cref="Regex"/>-derived type for the GetFrameRegex method.</summary> 92/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 95/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 450/// <summary>Custom <see cref="Regex"/>-derived type for the GetInvalidJsonBackslashRegex method.</summary> 469/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 472/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 601/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 605/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 606internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 609internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Commands\Test\MTP\Terminal\AnsiDetector.cs (1)
18private static readonly Regex[] TerminalsRegexes =
Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
80private static partial Regex GetFrameRegex();
Commands\Test\VSTest\TestCommand.cs (1)
687private static readonly Regex[] TerminalsRegexes =
Extensions\ParseResultExtensions.cs (1)
168Regex.Split(formatString, @"{[0-9]+}");
SlnFileFactory.cs (1)
151private static partial Regex GetInvalidJsonBackslashRegex();
dotnet-aot (16)
_generated\116\RegexGenerator.g.cs (12)
34private static partial global::System.Text.RegularExpressions.Regex GetFrameRegex() => global::System.Text.RegularExpressions.Generated.GetFrameRegex_0.Instance; 55private static partial global::System.Text.RegularExpressions.Regex GetInvalidJsonBackslashRegex() => global::System.Text.RegularExpressions.Generated.GetInvalidJsonBackslashRegex_1.Instance; 71/// <summary>Custom <see cref="Regex"/>-derived type for the GetFrameRegex method.</summary> 92/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 95/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 450/// <summary>Custom <see cref="Regex"/>-derived type for the GetInvalidJsonBackslashRegex method.</summary> 469/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 472/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 601/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 605/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 606internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 609internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\sdk\src\Cli\dotnet\Commands\Test\MTP\Terminal\AnsiDetector.cs (1)
18private static readonly Regex[] TerminalsRegexes =
src\sdk\src\Cli\dotnet\Commands\Test\MTP\Terminal\TerminalTestReporter.cs (1)
80private static partial Regex GetFrameRegex();
src\sdk\src\Cli\dotnet\Extensions\ParseResultExtensions.cs (1)
168Regex.Split(formatString, @"{[0-9]+}");
src\sdk\src\Cli\dotnet\SlnFileFactory.cs (1)
151private static partial Regex GetInvalidJsonBackslashRegex();
dotnet-dev-certs (21)
_generated\10\RegexGenerator.g.cs (16)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 86/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslVersionRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
dotnet-Microsoft.XmlSerializer.Generator (1)
Sgen.cs (1)
629match = Regex.Match(reference, pattern);
dotnet-svcutil-lib (19)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
147private static volatile Regex s_outputRegWithFileAndLine; 148private static volatile Regex s_outputRegSimple;
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (2)
153private static volatile Regex s_outputReg; 3282string[] lines = Regex.Split(fileStr, @"\r\n");
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (5)
882Regex regex = (Regex)restriction.Patterns[i]; 1353private static Regex s_languagePattern; 1355private static Regex LanguagePattern 1361Regex langRegex = new Regex("^([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*$", RegexOptions.None);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (4)
67private static Dictionary<string, Regex> s_regexs = new Dictionary<string, Regex>(); 68static internal Regex NewRegex(string pattern) 70Regex regex;
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
311private static volatile Regex s_encodeCharPattern; 312private static volatile Regex s_decodeCharPattern;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
2314if (Regex.IsMatch(internalsVisibleAttributeAssemblyName, Globals.SimpleSRSInternalsVisiblePattern) || 2315Regex.IsMatch(internalsVisibleAttributeAssemblyName, Globals.FullSRSInternalsVisiblePattern))
dotnet-svcutil-lib.Tests (2)
FixupUtil.cs (1)
150updatedText = Regex.Replace(updatedText, target, value, regexOptions);
ProjectUtils.cs (1)
151sw2.Write(System.Text.RegularExpressions.Regex.Replace(csprojStr, @"<ItemGroup>\s+<PackageReference Include=""System.ServiceModel[\S\s]+ItemGroup>", ""));
GenerateDocumentationAndConfigFiles (8)
Program.cs (3)
585description = Regex.Replace(description, "(\r?\n)", "$1$1"); 590description = Regex.Replace(description, @"(?:http|ftp)s?:\/\/[^\s\]""']*(?:\/|[^\s\]""'\W])", "<$0>"); 618=> Regex.Replace(text, "(<.+?>)", "\\$1").Replace("*", @"\*");
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (4)
120if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 131if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 140if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 151if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
GetDocument.Insider (1)
Commands\GetDocumentCommandWorker.cs (1)
290if (!string.IsNullOrWhiteSpace(_context.FileName) && !Regex.IsMatch(_context.FileName, "^([A-Za-z0-9-_]+)$"))
ILCompiler.Compiler (2)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (2)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav) 250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
ILCompiler.ReadyToRun (2)
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (2)
240private void MatchType(TypeDesc type, Regex regex, XPathNavigator nav) 250Regex regex = new Regex(fullname.Replace(".", @"\.").Replace("*", "(.*)"));
illink (16)
Infrastructure.Tests (39)
CreateFailingTestIssue\CreateFailingTestIssueToolTests.cs (1)
987var fileName = System.Text.RegularExpressions.Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
DownloadFailingJobLogs\DownloadFailingJobLogsToolTests.cs (1)
203var fileName = Regex.Replace(endpoint, @"[^A-Za-z0-9._-]+", "_").Trim('_');
Pipelines\NixCliPackageTests.cs (1)
61var match = System.Text.RegularExpressions.Regex.Match(
Pipelines\ReleasePublishNugetPipelineTests.cs (2)
468var semverRegexUses = System.Text.RegularExpressions.Regex.Matches( 596var secretReferenceMatches = System.Text.RegularExpressions.Regex.Matches(job, @"\b(VSCE_PAT|VscePublishToken)\b");
PowerShellScripts\ScanTestPartitionsFromSourceGuardTests.cs (2)
29private static readonly Regex s_standaloneLiteral = new( 36private static readonly Regex s_anyPartitionTrait = new(
PowerShellScripts\ValidateNpmReleaseAliasesTests.cs (2)
195var withoutAnsi = Regex.Replace(output, @"\u001b\[[0-9;]*m", string.Empty); 196return Regex.Replace(withoutAnsi.Replace("|", " "), @"\s+", " ");
TestTriggerMap\SelectTestsAcceptanceTests.cs (1)
989return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")
TestTriggerMap\SelectTestsCliTests.cs (2)
452var testProjectPaths = System.Text.RegularExpressions.Regex 472var deploymentProject = System.Text.RegularExpressions.Regex.Match(
TestTriggerMap\TestTriggerMapModel.cs (3)
104var regex = "^" + System.Text.RegularExpressions.Regex.Escape(before) + "([^/]+)" + 105System.Text.RegularExpressions.Regex.Escape(after) + (hasGlobSuffix ? "/.+" : "") + "$"; 107var match = System.Text.RegularExpressions.Regex.Match(path, regex);
TestTriggerMap\TestTriggerMapTests.cs (7)
145return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"") 315var documented = System.Text.RegularExpressions.Regex 322var documentedInMap = System.Text.RegularExpressions.Regex 431var declared = System.Text.RegularExpressions.Regex 437var consumed = System.Text.RegularExpressions.Regex 625var usesLocalAction = new System.Text.RegularExpressions.Regex( 690var next = System.Text.RegularExpressions.Regex.Match(
tools\GenerateCITimeline\TimelineRenderer.cs (2)
152private static partial Regex MatrixParamsRegex(); 155private static partial Regex TestsPrefixRegex();
WorkflowScripts\CiWorkflowTests.cs (5)
43var checkout = System.Text.RegularExpressions.Regex.Match(job, "(?ms)^ - uses: actions/checkout@.*?(?=^ - |\\z)"); 57var job = System.Text.RegularExpressions.Regex.Match( 59$@"(?ms)^ {System.Text.RegularExpressions.Regex.Escape(jobName)}:\n(?<body>.*?)(?=^ [A-Za-z0-9_-]+:\n|\z)"); 67var step = System.Text.RegularExpressions.Regex.Match( 69$@"(?ms)^ - name: {System.Text.RegularExpressions.Regex.Escape(stepName)}\n.*?(?=^ - |\z)");
WorkflowScripts\ExtensionChangelogFinalizedWorkflowTests.cs (2)
530var match = Regex.Match( 532$"(?m)^{Regex.Escape(key)}:\\r?\\n(?<value>(?:^[ ].*\\r?\\n)*)",
WorkflowScripts\ExtensionReleaseWorkflowTests.cs (1)
676var match = System.Text.RegularExpressions.Regex.Match(
WorkflowScripts\PrDocsCheckWorkflowTests.cs (7)
38Assert.Empty(Regex.Matches(customSteps, "actions/checkout@", RegexOptions.CultureInvariant).Cast<Match>()); 73Regex.Matches(safeOutputs, "uses: actions/checkout@", RegexOptions.CultureInvariant).Cast<Match>(), 221var match = Regex.Match( 231var run = Regex.Match( 235var env = Regex.Match( 242var referencedVariables = Regex.Matches( 250var boundVariables = Regex.Matches(
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.Agents.AI.ProjectTemplates.Tests (7)
TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (2)
24private readonly Regex _regex; 28var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
Microsoft.AspNetCore.Authentication.Negotiate (9)
_generated\1\RegexGenerator.g.cs (8)
21internal static partial global::System.Text.RegularExpressions.Regex DistinguishedNameSeparatorRegex => global::System.Text.RegularExpressions.Generated.DistinguishedNameSeparatorRegex_0.Instance; 37/// <summary>Custom <see cref="Regex"/>-derived type for the DistinguishedNameSeparatorRegex method.</summary> 56/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 59/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 168/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 172/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 173internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 176internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Internal\LdapAdapter.cs (1)
18internal static partial Regex DistinguishedNameSeparatorRegex { get; }
Microsoft.AspNetCore.Components (14)
_generated\7\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex AlphaRouteRegex => global::System.Text.RegularExpressions.Generated.AlphaRouteRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the AlphaRouteRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 136/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 140/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 144internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Http\Routing\src\Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex AlphaRouteRegex { get; }
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (5)
27private readonly Func<Regex>? _regexFactory; 28private Regex? _constraint; 33/// <param name="regex">A <see cref="Regex"/> instance to use as a constraint.</param> 34public RegexRouteConstraint(Regex regex) 62public Regex Constraint
Microsoft.AspNetCore.Components.Testing (3)
Infrastructure\ResourceLock.cs (3)
33private readonly Regex _urlPattern; 39ResourceLock(IPage page, Regex urlPattern) 52public static async Task<ResourceLock> CreateAsync(IPage page, Regex urlPattern)
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
DebugProxyLauncher.cs (3)
19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.DeveloperCertificates.XPlat (21)
_generated\0\RegexGenerator.g.cs (16)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 86/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslVersionRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\JsonTranscodingRouteAdapter.cs (2)
122var constraint = suffix.Length > 0 ? $":regex({Regex.Escape(suffix)}$)" : string.Empty; 184tempSegments[i] = $"{{**__Discard_{i}:regex({Regex.Escape($":{pattern.Verb}")}$)}}";
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
52private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 61private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Rewrite (8)
ApacheModRewrite\Tokenizer.cs (1)
109tokens[i] = Regex.Unescape(trimmed);
IISUrlRewrite\UriMatchCondition.cs (1)
27var regex = new Regex(
IISUrlRewrite\UrlRewriteRuleBuilder.cs (2)
49var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout); 54var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
RedirectRule.cs (1)
14public Regex InitialMatch { get; }
RewriteRule.cs (1)
14public Regex InitialMatch { get; }
UrlMatches\RegexMatch.cs (2)
10private readonly Regex _match; 12public RegexMatch(Regex match, bool negate)
Microsoft.AspNetCore.Routing (15)
_generated\1\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex AlphaRouteRegex => global::System.Text.RegularExpressions.Generated.AlphaRouteRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the AlphaRouteRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 136/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 140/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 141internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 144internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Constraints\AlphaRouteConstraint.cs (1)
28private static partial Regex AlphaRouteRegex { get; }
Constraints\RegexRouteConstraint.cs (5)
27private readonly Func<Regex>? _regexFactory; 28private Regex? _constraint; 33/// <param name="regex">A <see cref="Regex"/> instance to use as a constraint.</param> 34public RegexRouteConstraint(Regex regex) 62public Regex Constraint
RouteConstraintBuilder.cs (1)
93/// <c>^(Product[0-9]+)</c>. See <see cref="System.Text.RegularExpressions.Regex"/> for more details.
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.Server.Kestrel.Core (21)
_generated\1\RegexGenerator.g.cs (16)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 86/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslVersionRegex method.</summary> 105/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 108/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 266/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 269/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 380/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 399/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 402/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 605/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 609/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 610internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 613internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Microsoft.AspNetCore.SpaServices.Extensions (2)
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
Util\EventedStreamReader.cs (1)
33public Task<Match> WaitForMatch(Regex regex)
Microsoft.Build (141)
_generated\10\RegexGenerator.g.cs (88)
75private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression_0.Instance; 125private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression2 => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression2_1.Instance; 156private static partial global::System.Text.RegularExpressions.Regex FilenameLocationFromOrigin => global::System.Text.RegularExpressions.Generated.FilenameLocationFromOrigin_2.Instance; 178private static partial global::System.Text.RegularExpressions.Regex LineFromLocation => global::System.Text.RegularExpressions.Generated.LineFromLocation_3.Instance; 203private static partial global::System.Text.RegularExpressions.Regex LineLineFromLocation => global::System.Text.RegularExpressions.Generated.LineLineFromLocation_4.Instance; 228private static partial global::System.Text.RegularExpressions.Regex LineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColFromLocation_5.Instance; 256private static partial global::System.Text.RegularExpressions.Regex LineColColFromLocation => global::System.Text.RegularExpressions.Generated.LineColColFromLocation_6.Instance; 287private static partial global::System.Text.RegularExpressions.Regex LineColLineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColLineColFromLocation_7.Instance; 321private static partial global::System.Text.RegularExpressions.Regex SectionMatcherRegex => global::System.Text.RegularExpressions.Generated.SectionMatcherRegex_8.Instance; 352private static partial global::System.Text.RegularExpressions.Regex PropertyMatcherRegex => global::System.Text.RegularExpressions.Generated.PropertyMatcherRegex_9.Instance; 412private static partial global::System.Text.RegularExpressions.Regex TerminalLoggerArgPattern => global::System.Text.RegularExpressions.Generated.TerminalLoggerArgPattern_10.Instance; 446private static partial global::System.Text.RegularExpressions.Regex VerbosityArgPattern => global::System.Text.RegularExpressions.Generated.VerbosityArgPattern_11.Instance; 497private static partial global::System.Text.RegularExpressions.Regex TerminalLoggerParametersArgPattern => global::System.Text.RegularExpressions.Generated.TerminalLoggerParametersArgPattern_12.Instance; 548private static partial global::System.Text.RegularExpressions.Regex ConsoleLoggerParametersArgPattern => global::System.Text.RegularExpressions.Generated.ConsoleLoggerParametersArgPattern_13.Instance; 592private static partial global::System.Text.RegularExpressions.Regex ItemVectorTransformRegex => global::System.Text.RegularExpressions.Generated.ItemVectorTransformRegex_14.Instance; 629private static partial global::System.Text.RegularExpressions.Regex ItemVectorTransformRawRegex => global::System.Text.RegularExpressions.Generated.ItemVectorTransformRawRegex_15.Instance; 654private static partial global::System.Text.RegularExpressions.Regex XmlDeclarationRegex => global::System.Text.RegularExpressions.Generated.XmlDeclarationRegex_16.Instance; 697private static partial global::System.Text.RegularExpressions.Regex CrackProjectLineRegex => global::System.Text.RegularExpressions.Generated.CrackProjectLineRegex_17.Instance; 722private static partial global::System.Text.RegularExpressions.Regex CrackPropertyLineRegex => global::System.Text.RegularExpressions.Generated.CrackPropertyLineRegex_18.Instance; 808private static partial global::System.Text.RegularExpressions.Regex RegistrySdkRegex => global::System.Text.RegularExpressions.Generated.RegistrySdkRegex_19.Instance; 828private static partial global::System.Text.RegularExpressions.Regex XmlnsPattern => global::System.Text.RegularExpressions.Generated.XmlnsPattern_20.Instance; 844/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression method.</summary> 865/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 868/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1697/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression2 method.</summary> 1718/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1721/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2055/// <summary>Custom <see cref="Regex"/>-derived type for the FilenameLocationFromOrigin method.</summary> 2076/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2079/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2352/// <summary>Custom <see cref="Regex"/>-derived type for the LineFromLocation method.</summary> 2373/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2376/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2474/// <summary>Custom <see cref="Regex"/>-derived type for the LineLineFromLocation method.</summary> 2495/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2498/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2629/// <summary>Custom <see cref="Regex"/>-derived type for the LineColFromLocation method.</summary> 2650/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2653/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2784/// <summary>Custom <see cref="Regex"/>-derived type for the LineColColFromLocation method.</summary> 2805/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2808/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2968/// <summary>Custom <see cref="Regex"/>-derived type for the LineColLineColFromLocation method.</summary> 2989/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2992/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3181/// <summary>Custom <see cref="Regex"/>-derived type for the SectionMatcherRegex method.</summary> 3200/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3203/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3596/// <summary>Custom <see cref="Regex"/>-derived type for the PropertyMatcherRegex method.</summary> 3615/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3618/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4040/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerArgPattern method.</summary> 4061/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4064/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4342/// <summary>Custom <see cref="Regex"/>-derived type for the VerbosityArgPattern method.</summary> 4363/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4366/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4587/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerParametersArgPattern method.</summary> 4608/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4611/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4825/// <summary>Custom <see cref="Regex"/>-derived type for the ConsoleLoggerParametersArgPattern method.</summary> 4846/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4849/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5063/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRegex method.</summary> 5084/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5087/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5457/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRawRegex method.</summary> 5476/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5479/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5769/// <summary>Custom <see cref="Regex"/>-derived type for the XmlDeclarationRegex method.</summary> 5788/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5791/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5977/// <summary>Custom <see cref="Regex"/>-derived type for the CrackProjectLineRegex method.</summary> 5998/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6001/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6447/// <summary>Custom <see cref="Regex"/>-derived type for the CrackPropertyLineRegex method.</summary> 6468/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6471/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6714/// <summary>Custom <see cref="Regex"/>-derived type for the RegistrySdkRegex method.</summary> 6733/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6736/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6885/// <summary>Custom <see cref="Regex"/>-derived type for the XmlnsPattern method.</summary> 6904/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6907/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 7010/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 7014/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 7015internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 7018internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (2)
24public SdkResolverManifest(string DisplayName, string Path, Regex ResolvableSdkRegex) 47public Regex ResolvableSdkRegex { get; private set; }
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
28private static partial Regex SectionMatcherRegex { get; } 31private static partial Regex PropertyMatcherRegex { get; }
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (4)
27internal Regex Regex { get; } 30Regex regex, 250sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 360sb.Append(Regex.Escape(currentChar.ToString()));
Construction\ProjectRootElement.cs (1)
68private static partial Regex XmlDeclarationRegex { get; }
Construction\Solution\SolutionFile.cs (2)
66private static partial Regex CrackProjectLineRegex { get; } 69private static partial Regex CrackPropertyLineRegex { get; }
Definition\ToolsetReader.cs (2)
207var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander\WellKnownFunctions.cs (3)
905else if (receiverType == typeof(Regex)) 907if (string.Equals(methodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 911returnVal = Regex.Replace(arg1, arg2, arg3);
Evaluation\IntrinsicFunctions.cs (1)
46private static partial Regex RegistrySdkRegex { get; }
Evaluation\PropertyFunctionReceiver.cs (1)
44typeof(Uri), typeof(Regex), typeof(Match), typeof(Group), typeof(Capture),
Globbing\MSBuildGlob.cs (7)
36public Regex Regex { get; } 38public GlobState(string globRoot, string fileSpec, bool isLegal, string fixedDirectoryPart, string wildcardDirectoryPart, string filenamePart, bool needsRecursion, Regex regex) 52private static readonly WeakValueDictionary<string, Regex> s_regexCache = new WeakValueDictionary<string, Regex>(); 59internal Regex TestOnlyRegex => _state.Value.Regex; 200Regex regex = null; 228Regex newRegex = new Regex(matchFileExpression, regexOptions);
Logging\TerminalLogger\TerminalLogger.cs (4)
1825private static partial Regex TerminalLoggerArgPattern { get; } 1827private static partial Regex VerbosityArgPattern { get; } 1829private static partial Regex TerminalLoggerParametersArgPattern { get; } 1831private static partial Regex ConsoleLoggerParametersArgPattern { get; }
Resources\Constants.cs (2)
276[DynamicDependency(PropertyFunctionMembers, typeof(Regex))] 392availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple<string, Type>(null, typeof(Regex)));
src\msbuild\src\Shared\CanonicalError.cs (8)
135private static partial Regex OriginCategoryCodeTextExpression { get; } 138private static partial Regex OriginCategoryCodeTextExpression2 { get; } 141private static partial Regex FilenameLocationFromOrigin { get; } 144private static partial Regex LineFromLocation { get; } 147private static partial Regex LineLineFromLocation { get; } 150private static partial Regex LineColFromLocation { get; } 153private static partial Regex LineColColFromLocation { get; } 156private static partial Regex LineColLineColFromLocation { get; }
Utilities\EngineFileUtilities.cs (6)
24private static List<Regex>? s_lazyWildCardExpansionRegexes; 570private static List<Regex> PopulateRegexFromEnvironment() 575return new List<Regex>(0); 579List<Regex> regexes = new List<Regex>(); 582Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\FileSpecMatchTester.cs (5)
20private readonly Regex _regex; 22private FileSpecMatcherTester(string currentDirectory, string unescapedFileSpec, string filenamePattern, Regex regex) 44Regex regex = null; 106private static void CreateRegexOrFilenamePattern(string unescapedFileSpec, string currentDirectory, out string filenamePattern, out Regex regex) 141out Regex regexObject,
Utilities\ProjectWriter.cs (2)
54private static partial Regex ItemVectorTransformRegex { get; } 57private static partial Regex ItemVectorTransformRawRegex { get; }
Utilities\Utilities.cs (1)
312private static partial Regex XmlnsPattern { get; }
Microsoft.Build.Framework (28)
_generated\1\RegexGenerator.g.cs (8)
34private static partial global::System.Text.RegularExpressions.Regex CommandLineNodeModeRegex => global::System.Text.RegularExpressions.Generated.CommandLineNodeModeRegex_0.Instance; 50/// <summary>Custom <see cref="Regex"/>-derived type for the CommandLineNodeModeRegex method.</summary> 71/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 74/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 221/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 225/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 226internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 229internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
BuildEnvironmentHelper.cs (2)
204Regex.IsMatch(processName, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 278Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Globbing\MSBuildPathMatcher.cs (7)
49private readonly Regex?[]? _cultureSensitiveDirectoryPatterns; 58private readonly Regex? _filePatternRegex; 84? new Regex?[_directoryPatterns.Length] 512Regex? regex) 578Regex? cultureSensitivePattern = _cultureSensitiveDirectoryPatterns?[patternIndex]; 603private static Regex CreateCultureSensitiveDirectoryRegex( 631private static Regex CreateCultureSensitiveFileRegex(string pattern, bool useInvariantCulture)
Logging\AnsiDetector.cs (1)
16private static readonly Regex[] terminalsRegexes =
NodeMode.cs (1)
154private static partial System.Text.RegularExpressions.Regex CommandLineNodeModeRegex { get; }
Telemetry\CrashTelemetry.cs (1)
171private static readonly Regex FilePathPattern = new(
Utilities\FileMatcher.cs (8)
151(Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(); 868Regex regexFileMatch, // can be null 893public Regex RegexFileMatch { get; } 1622out Regex regexFileMatch, 1644out Regex regexFileMatch, 1654GetFileSpecInfoWithRegexObjectCore(key.FileSpec, out var regex, out var needsRec, out var isLegal); 1993Regex regexFileMatch; 2015Regex fileSpecRegex,
Microsoft.Build.Tasks.CodeAnalysis (7)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (7)
54private static readonly Regex s_originCategoryCodeTextExpression = new Regex 76private static readonly Regex s_filenameLocationFromOrigin = new Regex(@" 88private static readonly Regex s_lineFromLocation = new Regex(@" 96private static readonly Regex s_lineLineFromLocation = new Regex(@" 106private static readonly Regex s_lineColFromLocation = new Regex(@" 116private static readonly Regex s_lineColColFromLocation = new Regex(@" 128private static readonly Regex s_lineColLineColFromLocation = new Regex(@"
Microsoft.Build.Tasks.Core (73)
_generated\0\RegexGenerator.g.cs (56)
75private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression_0.Instance; 125private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression2 => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression2_1.Instance; 156private static partial global::System.Text.RegularExpressions.Regex FilenameLocationFromOrigin => global::System.Text.RegularExpressions.Generated.FilenameLocationFromOrigin_2.Instance; 178private static partial global::System.Text.RegularExpressions.Regex LineFromLocation => global::System.Text.RegularExpressions.Generated.LineFromLocation_3.Instance; 203private static partial global::System.Text.RegularExpressions.Regex LineLineFromLocation => global::System.Text.RegularExpressions.Generated.LineLineFromLocation_4.Instance; 228private static partial global::System.Text.RegularExpressions.Regex LineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColFromLocation_5.Instance; 256private static partial global::System.Text.RegularExpressions.Regex LineColColFromLocation => global::System.Text.RegularExpressions.Generated.LineColColFromLocation_6.Instance; 287private static partial global::System.Text.RegularExpressions.Regex LineColLineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColLineColFromLocation_7.Instance; 305private static partial global::System.Text.RegularExpressions.Regex MsbuildMessageCodePattern => global::System.Text.RegularExpressions.Generated.MsbuildMessageCodePattern_8.Instance; 338private static partial global::System.Text.RegularExpressions.Regex PlatformMonikerRegex => global::System.Text.RegularExpressions.Generated.PlatformMonikerRegex_9.Instance; 382private static partial global::System.Text.RegularExpressions.Regex AssemblyNameRegex => global::System.Text.RegularExpressions.Generated.AssemblyNameRegex_10.Instance; 412private static partial global::System.Text.RegularExpressions.Regex AssemblyVersionRegex => global::System.Text.RegularExpressions.Generated.AssemblyVersionRegex_11.Instance; 446private static partial global::System.Text.RegularExpressions.Regex SdkReferenceFormatRegex => global::System.Text.RegularExpressions.Generated.SdkReferenceFormatRegex_12.Instance; 462/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression method.</summary> 483/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 486/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1315/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression2 method.</summary> 1336/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1339/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1673/// <summary>Custom <see cref="Regex"/>-derived type for the FilenameLocationFromOrigin method.</summary> 1694/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1697/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1970/// <summary>Custom <see cref="Regex"/>-derived type for the LineFromLocation method.</summary> 1991/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1994/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2092/// <summary>Custom <see cref="Regex"/>-derived type for the LineLineFromLocation method.</summary> 2113/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2116/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2247/// <summary>Custom <see cref="Regex"/>-derived type for the LineColFromLocation method.</summary> 2268/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2271/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2402/// <summary>Custom <see cref="Regex"/>-derived type for the LineColColFromLocation method.</summary> 2423/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2426/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2586/// <summary>Custom <see cref="Regex"/>-derived type for the LineColLineColFromLocation method.</summary> 2607/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2610/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2799/// <summary>Custom <see cref="Regex"/>-derived type for the MsbuildMessageCodePattern method.</summary> 2818/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2821/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2917/// <summary>Custom <see cref="Regex"/>-derived type for the PlatformMonikerRegex method.</summary> 2938/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2941/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3085/// <summary>Custom <see cref="Regex"/>-derived type for the AssemblyNameRegex method.</summary> 3106/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3109/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3790/// <summary>Custom <see cref="Regex"/>-derived type for the AssemblyVersionRegex method.</summary> 3809/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3812/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3988/// <summary>Custom <see cref="Regex"/>-derived type for the SdkReferenceFormatRegex method.</summary> 4009/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4012/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4156/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 4160/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 4161internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 4164internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (2)
26private static readonly Lazy<Regex> s_crackAssemblyFoldersFromConfigSentinel = new Lazy<Regex>(
BootstrapperUtil\BuildMessage.cs (1)
20private static partial Regex MsbuildMessageCodePattern { get; }
Exec.cs (1)
426match = Regex.IsMatch(singleLine, regularExpression);
FindInvalidProjectReferences.cs (1)
29private static partial Regex PlatformMonikerRegex { get; }
ManifestUtil\AssemblyIdentity.cs (2)
67private static partial Regex AssemblyNameRegex { get; } 179Regex re = AssemblyNameRegex;
NativeMethods.cs (1)
239private static partial Regex AssemblyVersionRegex { get; }
ResolveSDKReference.cs (1)
43private static partial Regex SdkReferenceFormatRegex { get; }
src\msbuild\src\Shared\CanonicalError.cs (8)
135private static partial Regex OriginCategoryCodeTextExpression { get; } 138private static partial Regex OriginCategoryCodeTextExpression2 { get; } 141private static partial Regex FilenameLocationFromOrigin { get; } 144private static partial Regex LineFromLocation { get; } 147private static partial Regex LineLineFromLocation { get; } 150private static partial Regex LineColFromLocation { get; } 153private static partial Regex LineColColFromLocation { get; } 156private static partial Regex LineColLineColFromLocation { get; }
Microsoft.Build.Utilities.Core (49)
_generated\0\RegexGenerator.g.cs (36)
75private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression_0.Instance; 125private static partial global::System.Text.RegularExpressions.Regex OriginCategoryCodeTextExpression2 => global::System.Text.RegularExpressions.Generated.OriginCategoryCodeTextExpression2_1.Instance; 156private static partial global::System.Text.RegularExpressions.Regex FilenameLocationFromOrigin => global::System.Text.RegularExpressions.Generated.FilenameLocationFromOrigin_2.Instance; 178private static partial global::System.Text.RegularExpressions.Regex LineFromLocation => global::System.Text.RegularExpressions.Generated.LineFromLocation_3.Instance; 203private static partial global::System.Text.RegularExpressions.Regex LineLineFromLocation => global::System.Text.RegularExpressions.Generated.LineLineFromLocation_4.Instance; 228private static partial global::System.Text.RegularExpressions.Regex LineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColFromLocation_5.Instance; 256private static partial global::System.Text.RegularExpressions.Regex LineColColFromLocation => global::System.Text.RegularExpressions.Generated.LineColColFromLocation_6.Instance; 287private static partial global::System.Text.RegularExpressions.Regex LineColLineColFromLocation => global::System.Text.RegularExpressions.Generated.LineColLineColFromLocation_7.Instance; 303/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression method.</summary> 324/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 327/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1156/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression2 method.</summary> 1177/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1180/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1514/// <summary>Custom <see cref="Regex"/>-derived type for the FilenameLocationFromOrigin method.</summary> 1535/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1538/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1811/// <summary>Custom <see cref="Regex"/>-derived type for the LineFromLocation method.</summary> 1832/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1835/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1933/// <summary>Custom <see cref="Regex"/>-derived type for the LineLineFromLocation method.</summary> 1954/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1957/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2088/// <summary>Custom <see cref="Regex"/>-derived type for the LineColFromLocation method.</summary> 2109/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2112/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2243/// <summary>Custom <see cref="Regex"/>-derived type for the LineColColFromLocation method.</summary> 2264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2427/// <summary>Custom <see cref="Regex"/>-derived type for the LineColLineColFromLocation method.</summary> 2448/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2451/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2640/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2644/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2645internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2648internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
31directoryPath = Regex.Replace(directoryPath, "%VSINSTALLDIR%",
CommandLineBuilder.cs (4)
145private Regex _allowedUnquoted; 152private Regex _definitelyNeedQuotes; 157private Regex DefinitelyNeedQuotes => _definitelyNeedQuotes ??= 163private Regex AllowedUnquoted => _allowedUnquoted ??=
src\msbuild\src\Shared\CanonicalError.cs (8)
135private static partial Regex OriginCategoryCodeTextExpression { get; } 138private static partial Regex OriginCategoryCodeTextExpression2 { get; } 141private static partial Regex FilenameLocationFromOrigin { get; } 144private static partial Regex LineFromLocation { get; } 147private static partial Regex LineLineFromLocation { get; } 150private static partial Regex LineColFromLocation { get; } 153private static partial Regex LineColColFromLocation { get; } 156private static partial Regex LineColLineColFromLocation { get; }
Microsoft.CodeAnalysis (22)
_generated\0\RegexGenerator.g.cs (12)
35private static partial global::System.Text.RegularExpressions.Regex GetSectionMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetSectionMatcherRegex_0.Instance; 66private static partial global::System.Text.RegularExpressions.Regex GetPropertyMatcherRegex() => global::System.Text.RegularExpressions.Generated.GetPropertyMatcherRegex_1.Instance; 82/// <summary>Custom <see cref="Regex"/>-derived type for the GetSectionMatcherRegex method.</summary> 101/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 104/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 497/// <summary>Custom <see cref="Regex"/>-derived type for the GetPropertyMatcherRegex method.</summary> 516/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 519/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 941/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 945/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 946internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 949internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
CommandLine\AnalyzerConfig.cs (2)
30private static partial Regex GetSectionMatcherRegex(); 33private static partial Regex GetPropertyMatcherRegex();
CommandLine\AnalyzerConfig.SectionNameMatching.cs (6)
20private static readonly ConcurrentDictionary<string, Regex> s_regexMap = []; 26internal Regex Regex { get; } 29Regex regex, 127var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled)); 257sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 367sb.Append(Regex.Escape(currentChar.ToString()));
Diagnostic\DiagnosticInfo.cs (1)
134var matches = Regex.Matches(message, @"\{\d+[}:]");
SourceGeneration\AdditionalSourcesCollection.cs (1)
28private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (9)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (4)
351if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase) || 352Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 356else if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase) || 357Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
MetaAnalyzers\ReleaseTrackingHelper.cs (4)
120if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 131if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 140if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 151if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.CodeStyle (2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
250public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 252public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 254public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.CodeAnalysis.Features (15)
CodeFixes\Configuration\ConfigurationUpdater.cs (3)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr);
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); 117var result = Regex.Replace(numericText, $"(.{{{interval}}})", "_$1", RegexOptions.RightToLeft);
DocumentationComments\CopilotDocumentationCommentGenerator.cs (1)
203copilotText = Regex.Replace(copilotText, @"\r?\n", " ");
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (2)
23private readonly Regex _regex; 27var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
207private static readonly Regex s_validNumberRegex =
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
37var regexType = compilation.GetTypeByMetadataName(typeof(Regex).FullName!); 49/// Finds public, static methods in <see cref="Regex"/> that have a parameter called 50/// 'pattern'. These are helpers (like <see cref="Regex.Replace(string, string, string)"/> 118if (syntaxFacts.StringComparer.Compare(nameof(Regex), name) == 0)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.NetAnalyzers (3)
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (2)
49private static readonly Regex s_AntiForgeryAttributeRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*Attribute$", RegexOptions.Compiled); 50private static readonly Regex s_AntiForgeryRegex = new("^[a-zA-Z]*Validate[a-zA-Z]*Anti[Ff]orgery[a-zA-Z]*$", RegexOptions.Compiled);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\AdditionalFileProvider.cs (1)
50=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
AbstractResxGenerator.cs (2)
864private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 865private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (9)
PatternMatching\RegexPatternMatcher.cs (5)
16/// A pattern matcher that uses a compiled <see cref="Regex"/> for matching. Performs 22Regex caseInsensitiveRegex, Regex caseSensitiveRegex, bool includeMatchedSpans, CultureInfo? culture) 44var caseInsensitive = new Regex(pattern, commonOptions | RegexOptions.IgnoreCase, timeout); 45var caseSensitive = new Regex(pattern, commonOptions, timeout);
Rename\RenameUtilities.cs (2)
290var regex = GetRegexForMatch(matchText); 327public static Regex GetRegexForMatch(string matchText)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
445var regex = RenameUtilities.GetRegexForMatch(renameText);
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (7)
TextFieldParser.cs (7)
29private readonly Regex _delimiterRegex; 33public QuoteDelimitedFieldBuilder(Regex delimiterRegex, string spaceChars) 147private Regex _delimiterRegex; 149private Regex _delimiterWithEndCharsRegex; 153private Regex _beginQuotesRegex; 301private Regex BeginQuotesRegex 1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.Data.Analysis.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.Diagnostics.NETCore.Client (1)
DiagnosticsClient\DiagnosticsClient.cs (1)
453Match match = Regex.Match(fileName, PidIpcEndpoint.DiagnosticsPortPattern);
Microsoft.DotNet.ApiCompat.Task (3)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (3)
13private readonly (Regex Regex, string ReplacementString)[] _patterns; 31_patterns = new (Regex Regex, string ReplacementString)[rawPatterns.Length]; 46foreach ((Regex regex, string replacementString) in _patterns)
Microsoft.DotNet.Arcade.Sdk (4)
src\CheckRequiredDotNetVersion.cs (1)
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.Manifest (2)
BuildModelFactory.cs (2)
62private readonly Regex LegacyRepositoryUriPattern = new Regex( 234string replacementUri = $"{Regex.Unescape(AzureDevOpsHostPattern)}/{m.Groups["account"].Value}";
Microsoft.DotNet.Build.Tasks.Installers (4)
src\CreateWixBuildWixpack.cs (3)
230var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>"); 642var regex = new Regex(@"<\?include\s+([^\s\?>]+)\s*\?>", RegexOptions.IgnoreCase); 954var eqMatch = Regex.Match(
src\GenerateCurrentVersion.cs (1)
98Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Build.Tasks.Workloads (2)
Utils.cs (1)
112string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
WorkloadPackageBase.cs (1)
265if (exclusionPatterns.Any(pattern => Regex.IsMatch(file, pattern)))
Microsoft.DotNet.Cli.Definitions (9)
_generated\6\RegexGenerator.g.cs (8)
88private static partial global::System.Text.RegularExpressions.Regex TimeoutPattern() => global::System.Text.RegularExpressions.Generated.TimeoutPattern_0.Instance; 105/// <summary>Custom <see cref="Regex"/>-derived type for the TimeoutPattern method.</summary> 125/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 128/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 982/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 986/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 987internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 990internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Commands\Test\TestCommandDefinition.MicrosoftTestingPlatform.cs (1)
361private static partial Regex TimeoutPattern();
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
373return Regex.Escape(Path.DirectorySeparatorChar.ToString());
Microsoft.DotNet.HotReload.Utils.Generator (1)
EditAndContinueCapabilitiesParser.cs (1)
12static public readonly Regex capabilitiesTokenizer = new (@"^\s*(?:(\S+)\s+)*(\S+)?$", RegexOptions.CultureInvariant);
Microsoft.DotNet.HotReload.Watch (22)
_generated\0\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex GetNowListeningOnRegex() => global::System.Text.RegularExpressions.Generated.GetNowListeningOnRegex_0.Instance; 47private static partial global::System.Text.RegularExpressions.Regex GetAspireDashboardUrlRegex() => global::System.Text.RegularExpressions.Generated.GetAspireDashboardUrlRegex_1.Instance; 74private static partial global::System.Text.RegularExpressions.Regex GetBuildDiagnosticRegex() => global::System.Text.RegularExpressions.Generated.GetBuildDiagnosticRegex_2.Instance; 90/// <summary>Custom <see cref="Regex"/>-derived type for the GetNowListeningOnRegex method.</summary> 110/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 113/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 295/// <summary>Custom <see cref="Regex"/>-derived type for the GetAspireDashboardUrlRegex method.</summary> 315/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 318/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 500/// <summary>Custom <see cref="Regex"/>-derived type for the GetBuildDiagnosticRegex method.</summary> 518/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 521/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 748/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 752/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 753internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 756internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
Process\WebServerProcessStateObserver.cs (4)
15private static readonly Regex s_nowListeningRegex = GetNowListeningOnRegex(); 16private static readonly Regex s_aspireDashboardUrlRegex = GetAspireDashboardUrlRegex(); 19private static partial Regex GetNowListeningOnRegex(); 22private static partial Regex GetAspireDashboardUrlRegex();
UI\BuildOutput.cs (2)
11private static readonly Regex s_buildDiagnosticRegex = GetBuildDiagnosticRegex(); 14private static partial Regex GetBuildDiagnosticRegex();
Microsoft.DotNet.ProjectTools (2)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (2)
262public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 264public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.DotNet.SourceBuild.Tasks (3)
src\UsageReport\UsagePattern.cs (2)
26public Regex CreateRegex() 36string regex = Regex.Escape(IdentityGlob).Replace("\\*", ".*");
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.Extensions.AI.Abstractions (8)
ChatCompletion\ChatResponseFormat.cs (2)
100private static Regex InvalidNameCharsRegex() => _invalidNameCharsRegex; 101private static readonly Regex _invalidNameCharsRegex = new("[^0-9A-Za-z_]", RegexOptions.Compiled);
Functions\AIFunctionFactory.cs (6)
1293private static Regex PotentiallyJsonRegex() => _potentiallyJsonRegex; 1294private static readonly Regex _potentiallyJsonRegex = new(PotentiallyJsonRegexString, RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled); 1337private static Regex CompilerGeneratedNameRegex() => _compilerGeneratedNameRegex; 1338private static readonly Regex _compilerGeneratedNameRegex = new(@"^<([^>]+)>\w__(.+)", RegexOptions.Compiled); 1347private static Regex InvalidNameCharsRegex() => _invalidNameCharsRegex; 1348private static readonly Regex _invalidNameCharsRegex = new("[^0-9A-Za-z]+", RegexOptions.Compiled);
Microsoft.Extensions.AI.Evaluation (10)
Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Console (10)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Quality (1)
EvaluationMetricExtensions.cs (1)
104Match match = Regex.Match(text, $@"<{tagName}>(?<value>.*?)</{tagName}>", Options);
Microsoft.Extensions.AI.Evaluation.Reporting (10)
parent\parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
SerializationChainingTests.cs (1)
52jsonFromElement = Regex.Replace(jsonFromElement, @"\s+", "");
Microsoft.Extensions.AI.Evaluation.Safety (10)
parent\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
587Regex.IsMatch(response.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase),
VerbatimHttpHandler.cs (1)
99return Regex.Replace(text, @"\s*", string.Empty);
VerbatimMultiPartHttpHandler.cs (2)
158return Regex.Replace(input, @"[^a-zA-Z0-9_ .,!?\r\n""=;\//\[\]-]", ""); 219Regex.Replace(text, @"\s*", string.Empty);
Microsoft.Extensions.AI.OpenAI (9)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\RegexGenerator.g.cs (8)
18private static partial global::System.Text.RegularExpressions.Regex InvalidAuthorNameRegex() => global::System.Text.RegularExpressions.Generated.InvalidAuthorNameRegex_0.Instance; 34/// <summary>Custom <see cref="Regex"/>-derived type for the InvalidAuthorNameRegex method.</summary> 53/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 56/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 140/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 144/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 145internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 148internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
OpenAIChatClient.cs (1)
882private static partial Regex InvalidAuthorNameRegex();
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIAssistantChatClientIntegrationTests.cs (1)
124var matches = Regex.Matches(listing, @"thread_\w+");
OpenAIConversionTests.cs (1)
2268private static string RemoveWhitespace(string input) => Regex.Replace(input, @"\s+", "");
Microsoft.Extensions.AI.Templates.Tests (7)
TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.Extensions.AI.Tests (4)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
1000private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Image\OpenTelemetryImageGeneratorTests.cs (1)
168static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
1062private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
150static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Microsoft.Extensions.Configuration.Binder.SourceGeneration (2)
Emitter\CoreBindingHelpers.cs (2)
21private static readonly Regex s_arrayBracketsRegex = new(Regex.Escape("[]"));
Microsoft.Extensions.Http.Diagnostics (2)
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
23public static Regex MakeRouteRegex() => new(RouteRegexString, RegexOptions.Compiled);
Http\HttpDependencyMetadataResolver.cs (1)
33private static readonly Regex _routeRegex = DownstreamDependencyMetadataManagerRegex.MakeRouteRegex();
Microsoft.Extensions.VectorData.ConformanceTests (1)
TestSuiteImplementationTests.cs (1)
40.Where(t => Regex.IsMatch(t.Name, """Tests(`\d+)?$""") && t.IsAbstract && !t.IsSealed && !t.IsInterface);
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
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)
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)
RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetadataExtractor (2)
Parser_2.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor.Unit.Tests (3)
RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics.Unit.Tests (3)
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)
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports.Unit.Tests (3)
RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Maui.Controls (4)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
WebView\WebView.cs (3)
302 var singleQuotes = Regex.Matches(js, @"(\\*?)'"); 324 js = Regex.Replace(js, @"(?<=[^\\])" + Regex.Escape(match), replacementStr);
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
12 static readonly Regex rxResourceFilenameValidation
Microsoft.ML.AutoML (1)
ColumnInference\ColumnTypeInference.cs (1)
219if (Regex.IsMatch(v, candidate, RegexOptions.IgnoreCase))
Microsoft.ML.CodeGenerator (3)
Templates\Azure\Console\AzureModelBuilder.cs (1)
59this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Templates\Console\ModelBuilder.cs (2)
65this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString()))); 77this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Microsoft.ML.Core (2)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Utilities\Utils.cs (1)
589return Regex.Replace(value, "[^A-Za-z0-9]", "");
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
337var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (5)
Commands\EvaluateCommand.cs (2)
50private readonly Regex _loadNamePattern; 55bool isVector = false, Regex namePattern = null, string groupName = null, string nameFormat = null)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.StandardTrainers (1)
Standard\LinearPredictorUtils.cs (1)
86name = Regex.Replace(name, @"[^\w\d_]", "_");
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
560string[] minMaxRegex = Regex.Split(paramValue, "(?<=[^eE])-");
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tests (3)
OnnxConversionTest.cs (2)
451fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\""); 2290fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\"");
Transformers\TextFeaturizerTests.cs (1)
367var expected = Regex.Replace(data[0].A, "[,|_|'|\"|;|\\.]", "");
Microsoft.ML.Tokenizers (56)
Model\SentencePieceBaseModel.cs (3)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 97SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 106internal Regex? SpecialTokensRegex { get; }
Model\TiktokenTokenizer.cs (8)
1201private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1203private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1273private static partial Regex Cl100kBaseRegex(); 1276internal static partial Regex P50kBaseRegex(); 1279internal static partial Regex O200kBaseRegex(); 1303(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1463(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1503(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
Normalizer\SentencePieceNormalizationStep.cs (3)
28/// step. The steps rely on string-only BCL APIs (<see cref="Regex"/>, <see cref="string.Normalize(NormalizationForm)"/>, 406private readonly Regex? _regex; 408private ReplaceStep(string? literal, Regex? regex, string content)
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\PreTokenizer.cs (8)
32internal static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex) 50private static partial Regex WhiteSpaceOrPunctuationRegex(); 79private static partial Regex WordOrNonWordRegex(); 109private static partial Regex WhiteSpaceRegex(); 133internal static IEnumerable<(int Offset, int Length)> SplitText(ReadOnlySpan<char> text, Regex regex) 140static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, int textLength) 157internal static bool TryGetMatch(Regex regex, string text, int beginning, int length, out (int offset, int length) match) 178internal static bool TryGetMatch(Regex regex, scoped ReadOnlySpan<char> text, int beginning, int length, out (int offset, int length) match)
PreTokenizer\RegexPreTokenizer.cs (8)
18private readonly Regex? _specialTokensRegex; 19private readonly Regex _regex; 27public RegexPreTokenizer(Regex regex, IReadOnlyDictionary<string, int>? specialTokens) 39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 57static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex, Regex? specialTokensRegex) 108static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, Regex? specialTokensRegex, int textLength)
RegexGenerator.g.cs (25)
50private static partial global::System.Text.RegularExpressions.Regex Cl100kBaseRegex() => global::System.Text.RegularExpressions.Generated.Cl100kBaseRegex_0.Instance; 91internal static partial global::System.Text.RegularExpressions.Regex P50kBaseRegex() => global::System.Text.RegularExpressions.Generated.P50kBaseRegex_1.Instance; 155internal static partial global::System.Text.RegularExpressions.Regex O200kBaseRegex() => global::System.Text.RegularExpressions.Generated.O200kBaseRegex_2.Instance; 174private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceOrPunctuationRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceOrPunctuationRegex_3.Instance; 193private static partial global::System.Text.RegularExpressions.Regex WordOrNonWordRegex() => global::System.Text.RegularExpressions.Generated.WordOrNonWordRegex_4.Instance; 210private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceRegex_5.Instance; 226/// <summary>Custom <see cref="Regex"/>-derived type for the Cl100kBaseRegex method.</summary> 244/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 676/// <summary>Custom <see cref="Regex"/>-derived type for the P50kBaseRegex method.</summary> 694/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 697/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1050/// <summary>Custom <see cref="Regex"/>-derived type for the O200kBaseRegex method.</summary> 1068/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1071/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1885/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceOrPunctuationRegex method.</summary> 1903/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1906/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2015/// <summary>Custom <see cref="Regex"/>-derived type for the WordOrNonWordRegex method.</summary> 2033/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2036/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2148/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceRegex method.</summary> 2166/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2169/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2250/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
Microsoft.NET.Build.Containers (27)
_generated\0\RegexGenerator.g.cs (8)
26private static partial global::System.Text.RegularExpressions.Regex BearerParameterSplitter() => global::System.Text.RegularExpressions.Generated.BearerParameterSplitter_0.Instance; 42/// <summary>Custom <see cref="Regex"/>-derived type for the BearerParameterSplitter method.</summary> 62/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 65/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 251/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 252internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 255internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
AuthHandshakeMessageHandler.cs (1)
635private static partial Regex BearerParameterSplitter();
ContainerHelpers.cs (1)
37private static Regex envVarRegex = new(@"^[a-zA-Z_]{1,}[a-zA-Z0-9_]*$");
DigestUtils.cs (2)
26private static readonly Dictionary<string, Regex> s_registeredAlgorithms = new(StringComparer.Ordinal) 149if (!s_registeredAlgorithms.TryGetValue(algorithm, out Regex? encodedPattern))
ImageBuilder.cs (1)
29internal static Regex aspnetPortRegex = new(@"(?<scheme>\w+)://(?<domain>([*+]|).+):(?<port>\d+)");
ReferenceParser.cs (14)
98public static readonly Regex DomainRegexp = new(domain); 104public static readonly Regex AnchoredDomainRegexp = new(anchored(domain)); 114public static readonly Regex TagRegexp = new(tag); 126public static readonly Regex anchoredTagRegexp = new(anchoredTag); 172public static readonly Regex DigestRegexp = new(digestPat); 182public static readonly Regex AnchoredDigestRegexp = new(anchored( 203public static readonly Regex NameRegexp = new(namePat); 218public static readonly Regex anchoredNameRegexp = new(anchoredName); 236public static readonly Regex ReferenceRegexp = new(referencePat); 250public static readonly Regex IdentifierRegexp = new(identifier); 264public static readonly Regex ShortIdentifierRegexp = new(shortIdentifier); 276private static readonly Regex anchoredIdentifierRegexp = new(anchoredIdentifier); 290private static readonly Regex anchoredShortIdentifierRegexp = new(anchoredShortIdentifier); 297private static string literal(string s) => Regex.Escape(s);
Microsoft.NET.Sdk.Publish.Tasks (5)
MsDeploy\VSMSDeployHostObject.cs (2)
54srcSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(Path.Combine(rootFolderOfFileToPublish, p.SourceFilePath)) + "$"); 63destSkipRuleItem.SetMetadata("AbsolutePath", Regex.Escape(p.DestinationFilePath) + "$");
MsDeploy\VsMSDeployObject.cs (1)
189RegularExpressions.Regex match = new(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase);
Tasks\MsDeploy\CreateParameterFile.cs (1)
163metadataValue = $"^{Regex.Escape(metadataValue)}$";
WebConfigTelemetry.cs (1)
13private static readonly Lazy<Regex> s_crackProjectLine = new(
Microsoft.NET.Sdk.StaticWebAssets.Tasks (12)
JSModules\ApplyJsModules.cs (1)
122Regex.Replace(jsModuleCandidatePath, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
MergeConfigurationProperties.cs (1)
100metadataValue = Regex.Replace(metadataValue, ";{2,}", ";");
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
ScopedCss\ApplyCssScopes.cs (1)
128Regex.Replace(scopedCssCandidate.ItemSpec, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
ScopedCss\RewriteCss.cs (1)
27private static readonly Regex s_deepCombinatorRegex = new($@"^{DeepCombinatorText}\s*", RegexOptions.None, s_regexTimeout);
UpdateExternallyDefinedStaticWebAssets.cs (5)
154private bool TryInferFingerprint(Regex[] fingerprintExpressions, string relativePath, out string fingerprint, out string newRelativePath) 158var regex = fingerprintExpressions[i]; 182private static Regex[] CreateFingerprintExpressions(ITaskItem[] fingerprintInferenceExpressions) 193var result = new Regex[fingerprintInferenceExpressions.Length]; 198var regex = new Regex(pattern, regexOptions);
Microsoft.TemplateEngine.Cli (2)
TemplateInvoker.cs (2)
152Regex pattern = new($"[{Regex.Escape(new string(invalidChars))}]");
Microsoft.TemplateEngine.Edge (2)
Mount\Archive\ZipFileDirectory.cs (2)
23string rx = Regex.Escape(pattern); 25Regex r = new Regex($"^{rx}$");
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (8)
Macros\BaseMacroConfig.cs (1)
156Regex.Match(string.Empty, regex);
Macros\RegexMacro.cs (1)
33value = Regex.Replace(value, stepInfo.Regex, stepInfo.Replacement);
Macros\RegexMatchMacro.cs (1)
30bool result = Regex.IsMatch(value, config.Pattern);
ValueForms\DefaultSafeNameValueFormFactory.cs (2)
18string workingValue = Regex.Replace(value, @"(^\s+|\s+$)", string.Empty); 19workingValue = Regex.Replace(workingValue, @"(((?<=\.)|^)(?=\d)|\W)", replacement);
ValueForms\KebabCaseValueFormFactory.cs (1)
21Regex pattern = new(@"(?:\p{Lu}\p{M}*)?(?:\p{Ll}\p{M}*)+|(?:\p{Lu}\p{M}*)+(?!\p{Ll})|\p{N}+|[^\p{C}\p{P}\p{Z}]+|[\u2700-\u27BF]");
ValueForms\ReplacementValueFormFactory.cs (2)
11public ReplacementValueFormSettings(Regex match, string? replacement) 17internal Regex Match { get; }
Microsoft.TemplateEngine.Utils (6)
InMemoryFileSystem.cs (6)
196Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 276Regex rx = new(Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".")); 358Regex rx = new("^" + Regex.Escape(pattern).Replace("\\*", ".*").Replace("\\?", ".") + "$");
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\TimeSpanParser.cs (1)
11static readonly Regex Pattern = new(@"(?<value>^\d+(?:\.\d+)?)\s*(?<suffix>ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase);
Microsoft.TestPlatform.Filter.Source (1)
FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
Microsoft.VisualBasic.Core (8)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (8)
1192Dim EscapedDelimiter As String = Regex.Escape(m_Delimiters(i)) 1343Private ReadOnly Property BeginQuotesRegex() As Regex 1461Private m_DelimiterRegex As Regex 1464Private m_DelimiterWithEndCharsRegex As Regex 1470Private m_BeginQuotesRegex As Regex 1473Private m_WhiteSpaceRegEx As Regex = New Regex("\s") 1548Public Sub New(ByVal DelimiterRegex As Regex, ByVal SpaceChars As String) 1690Private m_DelimiterRegex As Regex
Microsoft.VisualStudio.TestPlatform.Common (2)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
Utilities\RunSettingsProviderExtensions.cs (1)
100Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (1)
HtmlLogger.cs (1)
44private static readonly Regex InvalidXmlCharsRegex = new(
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.VisualStudio.TestPlatform.ObjectModel (3)
Client\FilterOptions.cs (2)
23/// Gets or sets the optional regular expression replacement string. When this property is set, <see cref="System.Text.RegularExpressions.Regex.Replace(string, string, string)"/> 24/// will be called upon property value instead of <see cref="System.Text.RegularExpressions.Regex.Match(string)"/> before matching.
DataCollector\Common\FileHelper.cs (1)
15private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
Microsoft.Web.XmlTransform (9)
XmlElementContext.cs (2)
296private static Regex nameAndArgumentsRegex = null; 297private Regex NameAndArgumentsRegex {
XmlTransforms.cs (7)
301static private RegularExpressions.Regex s_dirRegex = null; 302static private RegularExpressions.Regex s_parentAttribRegex = null; 303static private RegularExpressions.Regex s_tokenFormatRegex = null; 306static internal RegularExpressions.Regex DirRegex 318static internal RegularExpressions.Regex ParentAttributeRegex 330static internal RegularExpressions.Regex TokenFormatRegex 377protected static string SubstituteKownValue(string transformValue, RegularExpressions.Regex patternRegex, string patternPrefix, GetValueCallback getValueDelegate )
Microsoft.Win32.Msi (2)
ActionStartEventArgs.cs (1)
48Match match = Regex.Match(message, @"Action\s(?<actionTime>\d+:\d+:\d+):\s+(?<actionName>.*)\.\s+(?<actionDescription>.*)");
ProgressEventArgs.cs (1)
31Match match = Regex.Match(message, @"(?<field>\d):\s+(?<value>\d+)");
MSBuild (1)
CommandLine\CommandLineParser.cs (1)
388responseFileLine = Regex.Replace(responseFileLine, responseFilePathReplacement,
netstandard (1)
netstandard.cs (1)
2052[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.Regex))]
NuGet.CommandLine.XPlat (1)
Commands\PackageSearch\Table.cs (1)
104return Regex.Replace(value ?? string.Empty, @"\r\n|\n\r|\n|\r|\t", " ");
NuGet.Common (7)
PathUtil\PathResolver.cs (4)
26List<Regex> filters = wildcards.Select(WildcardToRegex).ToList(); 73private static Regex WildcardToRegex(string wildcard) 75string pattern = Regex.Escape(wildcard); 133Regex searchRegex = WildcardToRegex(Path.Combine(basePath, searchPath));
PathUtil\PathValidator.cs (3)
44if (!Regex.IsMatch(path.Trim(), @"^[A-Za-z]:\\")) 92return Regex.IsMatch(url, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && Uri.TryCreate(url, UriKind.Absolute, out _); 101return !Regex.IsMatch(path, @"^\w+://", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant) && !Path.IsPathRooted(path);
NuGet.Configuration (3)
PackageSource\PackageSourceProvider.cs (1)
488var match = Regex.Match(rawCredentials!.Trim(), @"^Username=(?<user>.*?);\s*Password=(?<pass>.*?)(?:;ValidAuthenticationTypes=(?<authTypes>.*?))?$", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
Proxy\WebProxy.cs (2)
20private Regex[]? _regExBypassList; 90return Regex.Escape(pattern)
NuGet.Packaging (4)
Licenses\LicenseExpressionTokenizer.cs (1)
13private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
Licenses\NuGetLicense.cs (1)
89var regex = new Regex("^[a-zA-Z0-9\\.\\-]+$", RegexOptions.CultureInvariant);
PackageCreation\Utility\PackageIdValidator.cs (1)
18private static readonly Regex IdRegex = new Regex(pattern: @"^\w+([.-]\w+)*$",
Signing\Content\KeyPairFileReader.cs (1)
14private static readonly Regex NamePattern = new Regex("^[a-zA-Z0-9\\.\\-/]+$", RegexOptions.CultureInvariant);
PresentationBuildTasks (1)
Microsoft\Build\Tasks\Windows\UidManager.cs (1)
1308private static partial Regex EscapedXmlEntities { get; }
PresentationFramework (1)
System\Windows\Documents\WinRTSpellerInterop.cs (1)
547private static partial Regex LexiconCultureRegex { get; }
Publishers.AppHost (1)
DistributedApplicationBuilderExtensions.cs (1)
118if (!System.Text.RegularExpressions.Regex.IsMatch(versionInput.Value, @"^\d+\.\d+\.\d+$"))
QuarantineTools.Tests (10)
ActiveIssueTests.cs (6)
66var count = Regex.Matches(updated, "ActiveIssue").Count; 123var count = Regex.Matches(norm, "using Xunit;").Count; 160var count = Regex.Matches(norm, "using Xunit;").Count; 165var activeIssueCount = Regex.Matches(norm, @"\[ActiveIssue\(").Count; 217var countWithSuffix = Regex.Matches(updatedWithSuffix, @"ActiveIssue").Count; 218var countWithoutSuffix = Regex.Matches(updatedWithoutSuffix, @"ActiveIssue").Count;
QuarantineScriptTests.cs (4)
67var count = Regex.Matches(updated, "QuarantinedTest").Count; 193var count = Regex.Matches(norm, "using Aspire.TestUtilities;").Count; 196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline);
RepoTasks (21)
_generated\0\RegexGenerator.g.cs (16)
23private static partial global::System.Text.RegularExpressions.Regex OpenSslVersionRegex => global::System.Text.RegularExpressions.Generated.OpenSslVersionRegex_0.Instance; 44private static partial global::System.Text.RegularExpressions.Regex OpenSslHashFilenameRegex => global::System.Text.RegularExpressions.Generated.OpenSslHashFilenameRegex_1.Instance; 70private static partial global::System.Text.RegularExpressions.Regex OpenSslCertificateExtensionRegex => global::System.Text.RegularExpressions.Generated.OpenSslCertificateExtensionRegex_2.Instance; 86/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslVersionRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 246/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslHashFilenameRegex method.</summary> 264/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 267/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 378/// <summary>Custom <see cref="Regex"/>-derived type for the OpenSslCertificateExtensionRegex method.</summary> 396/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 399/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 602/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 606/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 607internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 610internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (2)
275var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 294var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
922private static partial Regex OpenSslVersionRegex { get; } 1000private static partial Regex OpenSslHashFilenameRegex { get; } 1007private static partial Regex OpenSslCertificateExtensionRegex { get; }
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Roslyn.Diagnostics.VisualBasic.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
sdk-tasks (4)
ReplaceFileContents.cs (1)
114var regex = new Regex(replacementPattern);
ZipFileCreateFromDirectory.cs (3)
68Regex[] regexes = new Regex[ExcludePatterns.Length]; 82foreach (var regex in regexes)
SelectTests (10)
ChangedFileFilter.cs (5)
29private static readonly ChangedFileFilter s_empty = new(Array.Empty<Regex>(), Array.Empty<string>()); 31private readonly IReadOnlyList<Regex> _patternRegexes; 34private ChangedFileFilter(IReadOnlyList<Regex> patternRegexes, IReadOnlyList<string> keepRoutedGlobs) 76foreach (var regex in _patternRegexes) 93private static Regex GlobToRegex(string glob)
Program.cs (2)
303System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")) 463return System.Text.RegularExpressions.Regex.Matches(slnx, "Path=\"([^\"]+\\.csproj)\"")
TriggerMap.cs (3)
157var regex = "^" + Regex.Escape(before) + "([^/]+)" + Regex.Escape(after) + (hasGlobSuffix ? "/.+" : "") + "$"; 159var match = Regex.Match(path, regex);
SuperFileCheck (2)
Program.cs (2)
79var regex = new System.Text.RegularExpressions.Regex(pattern); 90var invalidRegex = new System.Text.RegularExpressions.Regex(invalidFullLinePattern);
System (1)
src\runtime\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 (9)
_generated\0\RegexGenerator.g.cs (8)
20private static partial global::System.Text.RegularExpressions.Regex ParameterReplacementRegex => global::System.Text.RegularExpressions.Generated.ParameterReplacementRegex_0.Instance; 36/// <summary>Custom <see cref="Regex"/>-derived type for the ParameterReplacementRegex method.</summary> 55/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 58/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 134/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 138/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 139internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 142internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\ComponentModel\Design\DesignerVerb.cs (1)
29private static partial Regex ParameterReplacementRegex { get; }
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
11private readonly Regex _regex;
System.Data.Common (23)
_generated\0\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (6)
52private static partial Regex ConnectionStringRegex { get; } 55private static partial Regex ConnectionStringRegexOdbc { get; } 65private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 69private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern 425Regex parser = (firstKey ? ConnectionStringRegexOdbc : ConnectionStringRegex);
System\Data\Common\DBCommandBuilder.cs (1)
29private readonly Regex _parameterNameParser;
System.Data.Odbc (22)
_generated\1\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (6)
52private static partial Regex ConnectionStringRegex { get; } 55private static partial Regex ConnectionStringRegexOdbc { get; } 65private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 67private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 69private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern 425Regex parser = (firstKey ? ConnectionStringRegexOdbc : ConnectionStringRegex);
System.Data.OleDb (22)
_generated\4\RegexGenerator.g.cs (16)
24private static partial global::System.Text.RegularExpressions.Regex ConnectionStringValidKeyRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringValidKeyRegex_0.Instance; 43private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteValueRegex_1.Instance; 69private static partial global::System.Text.RegularExpressions.Regex ConnectionStringQuoteOdbcValueRegex => global::System.Text.RegularExpressions.Generated.ConnectionStringQuoteOdbcValueRegex_2.Instance; 85/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringValidKeyRegex method.</summary> 104/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 107/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 272/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteValueRegex method.</summary> 291/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 294/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 373/// <summary>Custom <see cref="Regex"/>-derived type for the ConnectionStringQuoteOdbcValueRegex method.</summary> 392/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 395/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 576/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 580/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 581internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 584internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
DbConnectionOptions.cs (6)
61private static partial Regex ConnectionStringRegex { get; } 64private static partial Regex ConnectionStringRegexOdbc { get; } 74private static partial Regex ConnectionStringValidKeyRegex { get; } // key not allowed to start with semi-colon or space or contain non-visible characters or end with space 76private static partial Regex ConnectionStringQuoteValueRegex { get; } // generally do not quote the value if it matches the pattern 78private static partial Regex ConnectionStringQuoteOdbcValueRegex { get; } // do not quote odbc value if it matches this pattern 778Regex parser = (firstKey ? ConnectionStringRegexOdbc : ConnectionStringRegex);
System.DirectoryServices.AccountManagement (2)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (2)
334Regex regex = filter.Extra as Regex;
System.Net.WebProxy (5)
System\Net\WebProxy.cs (5)
26private Regex[]? _regexBypassList; 335Regex[]? regexBypassList = null; 338regexBypassList = new Regex[bypassList.Count]; 369if (_regexBypassList is Regex[] regexBypassList) 384foreach (Regex r in regexBypassList)
System.Private.DataContractSerialization (9)
_generated\0\RegexGenerator.g.cs (8)
174public static partial global::System.Text.RegularExpressions.Regex FullSRSInternalsVisibleRegex => global::System.Text.RegularExpressions.Generated.FullSRSInternalsVisibleRegex_0.Instance; 190/// <summary>Custom <see cref="Regex"/>-derived type for the FullSRSInternalsVisibleRegex method.</summary> 209/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 212/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 408/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 412/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 413internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 416internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Runtime\Serialization\Globals.cs (1)
134public static partial Regex FullSRSInternalsVisibleRegex { get; }
System.Private.Xml (67)
_generated\0\RegexGenerator.g.cs (52)
25private static partial global::System.Text.RegularExpressions.Regex DecodeCharRegex => global::System.Text.RegularExpressions.Generated.DecodeCharRegex_0.Instance; 50private static partial global::System.Text.RegularExpressions.Regex EncodeCharRegex => global::System.Text.RegularExpressions.Generated.EncodeCharRegex_1.Instance; 74private static partial global::System.Text.RegularExpressions.Regex LanguageRegex => global::System.Text.RegularExpressions.Generated.LanguageRegex_2.Instance; 103private static partial global::System.Text.RegularExpressions.Regex Regex1 => global::System.Text.RegularExpressions.Generated.Regex1_3.Instance; 126private static partial global::System.Text.RegularExpressions.Regex Regex2 => global::System.Text.RegularExpressions.Generated.Regex2_4.Instance; 161private static partial global::System.Text.RegularExpressions.Regex EnsureArrayIndexRegex => global::System.Text.RegularExpressions.Generated.EnsureArrayIndexRegex_5.Instance; 183private static partial global::System.Text.RegularExpressions.Regex P0Regex => global::System.Text.RegularExpressions.Generated.P0Regex_6.Instance; 203private static partial global::System.Text.RegularExpressions.Regex UnknownNodeNullAnyTypeRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeNullAnyTypeRegex_7.Instance; 226private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectEmptyRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectEmptyRegex_8.Instance; 246private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectNullRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectNullRegex_9.Instance; 266private static partial global::System.Text.RegularExpressions.Regex UnknownNodeObjectRegex => global::System.Text.RegularExpressions.Generated.UnknownNodeObjectRegex_10.Instance; 286private static partial global::System.Text.RegularExpressions.Regex ParamsReadRegex => global::System.Text.RegularExpressions.Generated.ParamsReadRegex_11.Instance; 302/// <summary>Custom <see cref="Regex"/>-derived type for the DecodeCharRegex method.</summary> 321/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 324/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 435/// <summary>Custom <see cref="Regex"/>-derived type for the EncodeCharRegex method.</summary> 454/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 457/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 594/// <summary>Custom <see cref="Regex"/>-derived type for the LanguageRegex method.</summary> 613/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 616/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 778/// <summary>Custom <see cref="Regex"/>-derived type for the Regex1 method.</summary> 799/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 802/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1068/// <summary>Custom <see cref="Regex"/>-derived type for the Regex2 method.</summary> 1089/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1092/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1247/// <summary>Custom <see cref="Regex"/>-derived type for the EnsureArrayIndexRegex method.</summary> 1268/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1271/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1592/// <summary>Custom <see cref="Regex"/>-derived type for the P0Regex method.</summary> 1613/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1616/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1797/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeNullAnyTypeRegex method.</summary> 1818/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1821/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1935/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectEmptyRegex method.</summary> 1956/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1959/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2108/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectNullRegex method.</summary> 2129/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2132/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2252/// <summary>Custom <see cref="Regex"/>-derived type for the UnknownNodeObjectRegex method.</summary> 2273/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2276/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2396/// <summary>Custom <see cref="Regex"/>-derived type for the ParamsReadRegex method.</summary> 2417/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2420/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2540/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 2544/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 2545internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 2548internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Xml\Schema\FacetChecker.cs (3)
874Regex regex = (Regex)restriction.Patterns[i]!; 1345private static partial Regex LanguageRegex { get; }
System\Xml\Serialization\SourceInfo.cs (2)
19private static partial Regex Regex1 { get; } 23private static partial Regex Regex2 { get; }
System\Xml\Serialization\XmlSerializationReaderILGen.cs (7)
2799private static partial Regex EnsureArrayIndexRegex { get; } 2802private static partial Regex P0Regex { get; } 3707private static partial Regex UnknownNodeNullAnyTypeRegex { get; } 3710private static partial Regex UnknownNodeObjectEmptyRegex { get; } 3713private static partial Regex UnknownNodeObjectNullRegex { get; } 3716private static partial Regex UnknownNodeObjectRegex { get; } 3719private static partial Regex ParamsReadRegex { get; }
System\Xml\XmlConvert.cs (3)
89Regex.ValueMatchEnumerator en = DecodeCharRegex.EnumerateMatches(name.AsSpan(underscorePos)); 284private static partial Regex DecodeCharRegex { get; } 287private static partial Regex EncodeCharRegex { get; }
System.Security.Permissions (2)
System\Net\WebPermission.cs (2)
18public WebPermission(NetworkAccess access, Regex uriRegex) { } 23public void AddPermission(NetworkAccess access, Regex uriRegex) { }
System.Text.Json (5)
_generated\0\RegexGenerator.g.cs (4)
23public static partial global::System.Text.RegularExpressions.Regex IntegerRegex => global::System.Text.RegularExpressions.Generated.IntegerRegex_0.Instance; 39/// <summary>Custom <see cref="Regex"/>-derived type for the IntegerRegex method.</summary> 57/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 60/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary>
System\Text\Json\JsonHelpers.cs (1)
315public static partial Regex IntegerRegex { get; }
System.Text.RegularExpressions (174)
System\Text\RegularExpressions\Capture.cs (1)
50/// If a call to the <see cref="Regex.Match(string)"/> or <see cref="Match.NextMatch"/> method fails to
System\Text\RegularExpressions\GeneratedRegexAttribute.cs (3)
15/// partial, parameterless, non-generic methods or get-only properties that are typed to return <see cref="Regex"/>. 18/// When the <see cref="Regex"/> supports case-insensitive matches (either by passing 25/// This differs from the rest of the <see cref="Regex"/> engines, which perform this transformation at run time,
System\Text\RegularExpressions\Match.cs (12)
13/// <see cref="Match"/> class is returned by the <see cref="Regex.Match(string)"/> method and 17/// objects is returned by the <see cref="Regex.Matches(string)"/> method. 20/// If the <see cref="Regex.Matches(string)"/> method fails to match a regular expression pattern in 25/// If the <see cref="Regex.Match(string)"/> method fails to match the regular expression pattern, it 47internal readonly Regex? _regex; 58internal Match(Regex? regex, int capcount, string? text, int textLength) : 142/// This method is similar to calling <see cref="Regex.Match(string, int)"/> again and passing 163Regex? r = _regex; 183/// Whereas the <see cref="Regex.Replace(string, string)"/> method replaces all matches in an 203Regex? regex = _regex ?? throw new NotSupportedException(SR.NoResultOnFailed); 209return Regex.SegmentsToStringAndDispose(ref segments); 466internal MatchSparse(Regex regex, Hashtable caps, int capcount, string? text, int textLength) :
System\Text\RegularExpressions\MatchCollection.cs (5)
13/// constructor. The <see cref="Regex.Matches(string)" /> method returns a 32/// with all matches resulting from a particular call to the <see cref="Regex.Matches(string)" /> 43/// <see cref="Regex.Match(string)" /> method repeatedly and adding each match to the collection. 59private readonly Regex _regex; 66internal MatchCollection(Regex regex, string input, int startat)
System\Text\RegularExpressions\Regex.Cache.cs (17)
22/// The <see cref="Regex"/> class maintains an internal cache of regular expression instances used in 23/// static <see cref="Regex"/> method calls, such as <see cref="Regex.Match(string, string)"/> or 24/// <see cref="Regex.Replace(string, string, string)"/>. If the value specified in a set operation is 131public static Regex GetOrAdd(string pattern) 137Regex.ValidatePattern(pattern); 140Key key = new Key(pattern, culture.ToString(), RegexOptions.None, Regex.s_defaultMatchTimeout); 142Regex? regex = Get(key); 152public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 154Regex.ValidatePattern(pattern); 155Regex.ValidateOptions(options); 156Regex.ValidateMatchTimeout(matchTimeout); 161Regex? regex = Get(key); 171private static Regex? Get(Key key) 215private static void Add(Key key, Regex regex) 331private sealed class Node(Key key, Regex regex) 336public readonly Regex Regex = regex;
System\Text\RegularExpressions\Regex.cs (14)
67/// <summary>Initializes a new instance of the <see cref="Regex" /> class.</summary> 82/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression. 93/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 109/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 232/// <summary>Initializes a new instance of the <see cref="Regex" /> class by using serialized data.</summary> 235/// <exception cref="PlatformNotSupportedException">Serialization of <see cref="Regex" /> objects is not supported.</exception> 287/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly. 297/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly with the specified attributes. 307/// Compiles one or more specified <see cref="Regex" /> objects and a specified resource file 405/// <summary>Gets the options that were passed into the <see cref="Regex" /> constructor.</summary> 408/// to the <see cref="Regex" /> constructor. 425/// <summary>Returns the regular expression pattern that was passed into the <see cref="Regex" /> constructor.</summary> 427/// The pattern that was passed into the <see cref="Regex" /> constructor. 549/// Used by a <see cref="Regex" /> object generated by the
System\Text\RegularExpressions\Regex.EnumerateMatches.cs (5)
103/// The enumerator has no public constructor. The <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/> 104/// method returns a <see cref="Regex.ValueMatchEnumerator"/> object. The enumerator will lazily iterate 117private readonly Regex _regex; 126/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 129internal ValueMatchEnumerator(Regex regex, ReadOnlySpan<char> input, int startAt)
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (3)
181private readonly Regex _regex; 192/// <param name="regex">The <see cref="Regex"/> to use for finding matches.</param> 197internal ValueSplitEnumerator(Regex regex, ReadOnlySpan<char> input, int count, int startAt, bool rtl)
System\Text\RegularExpressions\Regex.Match.cs (28)
32/// <see cref="Regex"/> object with the specified pattern and calling the <see cref="IsMatch(string)"/> 81/// <see cref="Regex"/> object with the specified pattern and options and calling the 115/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 140/// constructing a <see cref="Regex"/> object with the specified pattern and options and calling the 163/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 180/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 201/// established for the application domain in which the <see cref="Regex"/> object is created. If no 202/// time-out is defined in the <see cref="Regex"/> constructor call or in the application domain's 203/// properties, or if the time-out value is <see cref="Regex.InfiniteMatchTimeout"/>, no exception 218/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 254/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 266/// Indicates whether the regular expression specified in the <see cref="Regex"/> constructor finds a 292/// <see cref="Regex"/> object with the specified pattern and calling the instance 329/// <see cref="Regex"/> object with the <see cref="Regex(string, RegexOptions)"/> constructor and calling 350/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 366/// constructing a <see cref="Regex"/> object with the 390/// the <see cref="Regex"/> constructor. 417/// established for the application domain in which the <see cref="Regex"/> object is created. If no 418/// time-out is defined in the <see cref="Regex"/> constructor call or in the application domain's 419/// properties, or if the time-out value is <see cref="Regex.InfiniteMatchTimeout"/>, no exception 590/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 635/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 662/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 684/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 731/// <see cref="Regex.MatchTimeout"/> property is not <see cref="Regex.InfiniteMatchTimeout"/> and a 780/// <see cref="Regex.MatchTimeout"/> property is not <see cref="Regex.InfiniteMatchTimeout"/> and a
System\Text\RegularExpressions\Regex.Replace.cs (16)
10/// <see cref="Regex.Replace(string, MatchEvaluator)"/> method operation. 13/// match during a <see cref="Regex.Replace(string, MatchEvaluator)"/> method operation.</param> 19/// <see cref="Regex.Replace(string, MatchEvaluator)"/>. For each matched string, the 20/// <see cref="Regex.Replace(string, MatchEvaluator)"/> method calls the 23/// the <see cref="Regex.Replace(string, MatchEvaluator)"/> method substitutes for the matched string. 52/// <see cref="Regex"/> object with the specified regular expression pattern and calling the instance method 97/// constructing a <see cref="Regex"/> object with the specified regular expression pattern and calling the 131/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to 152/// to constructing a <see cref="Regex"/> object with the specified regular expression pattern and calling 344/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 390/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 419/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to 445/// The method is equivalent to calling the <see cref="Regex.Matches(string, string)"/> method and passing 492/// The method is equivalent to calling the <see cref="Regex.Matches(string)"/> method and passing each 537/// The method is equivalent to calling the <see cref="Regex.Matches(string)"/> method and passing the 610private static string Replace(MatchEvaluator evaluator, Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Split.cs (17)
26/// <see cref="Regex"/> object with the specified regular expression pattern and calling the 30/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 31/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 67/// constructing a <see cref="Regex"/> object with the specified regular expression pattern 71/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 72/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 102/// A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate that the 120/// equivalent to constructing a <see cref="Regex"/> object with the specified regular 124/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 125/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 152/// regular expression pattern specified in the <see cref="Regex"/> constructor. 162/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to the 163/// <see cref="string.Split(char[])"/> method, except that <see cref="Regex.Split(string)">Regex.Split</see> splits 193/// at the positions defined by a regular expression specified in the <see cref="Regex"/> 205/// The <see cref="Regex.Split(string)">Regex.Split</see> methods are similar to 232/// at the positions defined by a regular expression specified in the <see cref="Regex"/> 278private static string[] Split(Regex regex, string input, int count, int startat)
System\Text\RegularExpressions\Regex.Timeout.cs (5)
19/// Setting this to a valid TimeSpan will cause that TimeSpan to be used as the timeout for <see cref="Regex"/> instances created 53/// The default timeout value to use if one isn't explicitly specified when creating the <see cref="Regex"/> 77/// <see cref="Regex"/> instance to execute a single matching operation before the operation times out. 86/// This property is read-only. You can set its value explicitly for an individual <see cref="Regex"/> 88/// set its value for all <see cref="Regex"/> matching operations in an application domain by calling
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (17)
75TypeBuilder regexTypeBuilder = DefineType(_module, name, isPublic, isSealed: false, typeof(Regex)); 79if (matchTimeout != Regex.InfiniteMatchTimeout) 112_ilg!.Emit(OpCodes.Call, typeof(Regex).GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, Type.EmptyTypes, Array.Empty<ParameterModifier>())!); 115Stfld(RegexField(nameof(Regex.pattern))); 118Stfld(RegexField(nameof(Regex.roptions))); 121Stfld(RegexField(nameof(Regex.factory))); 125if (matchTimeout == Regex.InfiniteMatchTimeout) 128_ilg.Emit(OpCodes.Ldsfld, RegexField(nameof(Regex.InfiniteMatchTimeout))); 136Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 141Stfld(RegexField(nameof(Regex.capsize))); 145GenerateCreateHashtable(RegexField(nameof(Regex.caps)), tree.CaptureNumberSparseMapping); 150GenerateCreateHashtable(RegexField(nameof(Regex.capnames)), tree.CaptureNameToNumberMapping); 161FieldInfo capslistField = RegexField(nameof(Regex.capslist)); 184Call(typeof(Regex).GetMethod(nameof(Regex.ValidateMatchTimeout), BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static)!); 187Stfld(RegexField(nameof(Regex.internalMatchTimeout))); 225typeof(Regex).GetField(fieldname, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)!;
System\Text\RegularExpressions\RegexCompilationInfo.cs (3)
37: this(pattern, options, name, fullnamespace, ispublic, Regex.s_defaultMatchTimeout) 80/// <see cref="RegexMatchTimeoutException"/> is thrown, or <see cref="Regex.InfiniteMatchTimeout"/> if time-outs are disabled. 87Regex.ValidateMatchTimeout(value);
System\Text\RegularExpressions\RegexMatchTimeoutException.cs (2)
170/// <see cref="Regex.Match(string, int)"/>. 199/// <see cref="Regex"/> constructor or static method. It does not reflect the exact interval
System\Text\RegularExpressions\RegexReplacement.cs (4)
194public string Replace(Regex regex, string input, int count, int startat) 226private static unsafe string ReplaceSimpleText(Regex regex, string input, string replacement, int count, int startat) 296private string ReplaceNonSimpleText(Regex regex, string input, int count, int startat) 343return Regex.SegmentsToStringAndDispose(ref state.segments);
System\Text\RegularExpressions\RegexRunner.cs (10)
102protected internal Regex? runregex; 115/// <summary>Used by a <see cref="Regex"/> object to scan the input <paramref name="text"/> looking for the next match.</summary> 119/// <see cref="ReadOnlySpan{T}"/>-based <see cref="Regex"/> methods are not supported from <see cref="Regex"/>-derived types 163/// <summary>Used by a <see cref="Regex"/> object to scan the input <paramref name="text"/>.</summary> 165protected Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick) => 173protected internal Match? Scan(Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick, TimeSpan timeout) 233private Match InternalScan(Regex regex, int textbeg, int textend) 278internal void InitializeForScan(Regex regex, ReadOnlySpan<char> text, int textstart, RegexRunnerMode mode) 345if (Regex.InfiniteMatchTimeout != timeout)
System\Text\RegularExpressions\RegexRunnerFactory.cs (2)
8/// <summary>Creates a <see cref="RegexRunner"/> for a <see cref="Regex"/>.</summary> 15/// <summary>Creates a <see cref="RegexRunner"/> instance for the <see cref="Regex"/>.</summary>
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (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)
10/// <see cref="Regex.ValueMatchEnumerator.Current"/> method when iterating over the results from 11/// calling <see cref="Regex.EnumerateMatches(ReadOnlySpan{char})"/>.
System.Windows.Forms (10)
_generated\2\RegexGenerator.g.cs (8)
18private static partial global::System.Text.RegularExpressions.Regex ContiguousNonWhitespace() => global::System.Text.RegularExpressions.Generated.ContiguousNonWhitespace_0.Instance; 34/// <summary>Custom <see cref="Regex"/>-derived type for the ContiguousNonWhitespace method.</summary> 53/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 56/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 140/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 144/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 145internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 148internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (2)
189Regex r = ContiguousNonWhitespace(); 208private static partial Regex ContiguousNonWhitespace();
System.Windows.Forms.Analyzers (1)
System\Windows\Forms\Analyzers\ApplicationConfig.FontDescriptor.cs (1)
29string name = Regex.Replace(Name, @"[^\w\d ]", string.Empty);
System.Windows.Forms.Design (11)
_generated\2\RegexGenerator.g.cs (9)
20private static partial global::System.Text.RegularExpressions.Regex SanitizeNameRegex() => global::System.Text.RegularExpressions.Generated.SanitizeNameRegex_0.Instance; 39private static partial global::System.Text.RegularExpressions.Regex ParenthesisRegex() => global::System.Text.RegularExpressions.Generated.SanitizeNameRegex_0.Instance; 55/// <summary>Custom <see cref="Regex"/>-derived type for the SanitizeNameRegex method.</summary> 74/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 77/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 153/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 157/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 158internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 161internal static readonly bool s_hasTimeout = s_defaultTimeout != Regex.InfiniteMatchTimeout;
System\ComponentModel\Design\DesignerActionItem.cs (1)
27private static partial Regex SanitizeNameRegex();
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (1)
2229private static partial Regex ParenthesisRegex();
TypeScriptApiCompat (1)
ApiCompatSuppression.cs (1)
132private static partial Regex SuppressionLineRegex();
vstest.console (3)
Internal\MSBuildLogger.cs (3)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 420private static Regex? s_regex; 433string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine);
vstest.console.arm64 (3)
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (3)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 420private static Regex? s_regex; 433string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine);