102 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 (1)
_generated\187\RegexGenerator.g.cs (1)
53file sealed class GetFrameRegex_0 : 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.Components (1)
_generated\1\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 (23)
_generated\0\RegexGenerator.g.cs (23)
1019file sealed class OriginCategoryCodeTextExpression_0 : Regex 1872file sealed class OriginCategoryCodeTextExpression2_1 : Regex 2230file sealed class FilenameLocationFromOrigin_2 : Regex 2527file sealed class LineFromLocation_3 : Regex 2649file sealed class LineLineFromLocation_4 : Regex 2804file sealed class LineColFromLocation_5 : Regex 2959file sealed class LineColColFromLocation_6 : Regex 3143file sealed class LineColLineColFromLocation_7 : Regex 3356file sealed class SectionMatcherRegex_8 : Regex 3771file sealed class PropertyMatcherRegex_9 : Regex 4215file sealed class TerminalLoggerArgPattern_10 : Regex 4517file sealed class VerbosityArgPattern_11 : Regex 4762file sealed class TerminalLoggerParametersArgPattern_12 : Regex 5000file sealed class ConsoleLoggerParametersArgPattern_13 : Regex 5238file sealed class ItemVectorTransformRegex_14 : Regex 5632file sealed class ItemVectorTransformRawRegex_15 : Regex 5944file sealed class XmlDeclarationRegex_16 : Regex 6152file sealed class CrackProjectLineRegex_17 : Regex 6622file sealed class CrackPropertyLineRegex_18 : Regex 6889file sealed class RegistrySdkRegex_19 : Regex 7060file sealed class ItemMetadataRegex_20 : Regex 7352file sealed class NonTransformItemMetadataRegex_21 : Regex 9213file sealed class XmlnsPattern_22 : 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.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.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
360 instantiations of Regex
aspire (2)
Utils\MarkdownToSpectreConverter.cs (2)
169var regex = new Regex(@"^>\s*(.*)$"); 215var spectreRegex = new Regex(spectrePattern);
Aspire.Dashboard (2)
Components\Layout\MobileNavMenu.razor.cs (2)
45LinkMatchRegex: new Regex($"^{DashboardUrls.ResourcesUrl()}(\\?.*)?$") 111return new Regex($"^({pageRelativeBasePath}|{pageRelativeBasePath}/.+)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Aspire.Dashboard.Tests (1)
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
22private static readonly Regex s_exportIdPattern = new(
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
47var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Aspire.Templates.Tests (2)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
tests\Shared\TemplatesTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
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)
671new("^xterm"), // xterm, PuTTY, Mintty 672new("^rxvt"), // RXVT 673new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 674new("^screen"), // GNU screen, tmux 675new("tmux"), // tmux 676new("^vt100"), // DEC VT series 677new("^vt102"), // DEC VT series 678new("^vt220"), // DEC VT series 679new("^vt320"), // DEC VT series 680new("ansi"), // ANSI 681new("scoansi"), // SCO ANSI 682new("cygwin"), // Cygwin, MinGW 683new("linux"), // Linux console 684new("konsole"), // Konsole 685new("bvterm"), // Bitvise SSH Client 686new("^st-256color"), // Suckless Simple Terminal, st 687new("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})_");
GenerateDocumentationAndConfigFiles (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
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)
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.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.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.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)
193var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Globbing\MSBuildGlob.cs (1)
218Regex newRegex = new Regex(matchFileExpression, regexOptions);
Utilities\EngineFileUtilities.cs (1)
577Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Microsoft.Build.Framework (20)
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)
1511regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2174matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
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)
119var 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.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.AnalyzerUtilities (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CodeStyle (8)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Features (3)
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.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
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.ResxSourceGenerator (8)
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
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 (10)
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);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (3)
TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.Data.Analysis.Tests (3)
src\Microsoft.Data.Analysis\TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.DotNet.ApiCompat.Task (1)
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)
97Regex 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 (3)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
251public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 253public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 255public 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.Evaluation (2)
Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Console (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Reporting (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.Evaluation.Safety (2)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (2)
36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 52new Regex(
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
860private static readonly Regex _invalidAuthorNameRegex = new(InvalidAuthorNamePattern, RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Maui.Controls (1)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
13 = new Regex(@"^[a-z]([a-z0-9_]*[a-z0-9])?$", RegexOptions.Singleline | RegexOptions.Compiled);
Microsoft.ML.Core (1)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
337var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (12)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Evaluators\MulticlassClassificationEvaluator.cs (2)
134isVector: true, namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", LogLoss), RegexOptions.IgnoreCase), 1029namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", MulticlassClassificationEvaluator.LogLoss), RegexOptions.IgnoreCase));
Evaluators\MultiOutputRegressionEvaluator.cs (4)
82isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L1), RegexOptions.IgnoreCase), 85isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L2), RegexOptions.IgnoreCase), 88isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Rms), RegexOptions.IgnoreCase), 91isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Loss), RegexOptions.IgnoreCase),
Evaluators\RankingEvaluator.cs (3)
148namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Ndcg), RegexOptions.IgnoreCase), 151namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Dcg), RegexOptions.IgnoreCase), 154namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", MaxDcg), RegexOptions.IgnoreCase),
Microsoft.ML.GenAI.LLaMA (1)
LlamaTokenizerHelper.cs (1)
52var preTokenizer = new RegexPreTokenizer(new Regex(_re), _specialTokens);
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
71Assert.Matches(new Regex(@"(\d+)\.(\d+)\.(\d+)(-[dev|ci|preview\.(\d+)\.(\d+)\.(\d+)]){0,1}"), line);
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tokenizers (3)
Model\SentencePieceBaseModel.cs (1)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Microsoft.ML.Tokenizers.Tests (1)
BpeTests.cs (1)
1057preTokenizers.Add(new RegexPreTokenizer(new Regex(pattern, RegexOptions.Compiled, TimeSpan.FromMilliseconds(DefaultTimeOutInMilliseconds)), null));
Microsoft.NET.Build.Containers (16)
ContainerHelpers.cs (1)
30private 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.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)
99Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
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);
PlatformDocAnalyzer (2)
PlatformDocAnalyzer.cs (2)
29private static readonly Regex s_memberRegex = new(@"<member\s+name=""([^""]+)"">(.*?)</member>", RegexOptions.Singleline | RegexOptions.Compiled); 30private static readonly Regex s_whitespaceRegex = new(@"\s+", RegexOptions.Compiled);
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.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\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);
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)
113? new Regex(Pattern) 114: new Regex(Pattern, default(RegexOptions), TimeSpan.FromMilliseconds(MatchTimeoutInMilliseconds));
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
18_regex = new Regex(regex, RegexOptions.Compiled);
System.Data.Common (1)
System\Data\Common\DBCommandBuilder.cs (1)
47_parameterNameParser = new Regex(_dbCommandBuilder.ParameterNamePattern!, RegexOptions.ExplicitCapture | RegexOptions.Singleline);
System.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");
tlens (1)
src\runtime\src\tools\illink\external\Mono.Options\Options.cs (1)
1177private readonly Regex ValueOption = new Regex(
vstest.console (1)
Internal\MSBuildLogger.cs (1)
472s_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)
472s_regex = new Regex(@$"^ {atString} (?<code>.+) {inPattern}$", RegexOptions.Compiled, matchTimeout: TimeSpan.FromSeconds(1));
1567 references to Regex
aspire (46)
Certificates\CertificateGeneration\MacOSCertificateManager.cs (2)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, maxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, maxRegexTimeout);
Certificates\CertificateGeneration\UnixCertificateManager.cs (3)
925private static partial Regex OpenSslVersionRegex { get; } 1007private static partial Regex OpenSslHashFilenameRegex { get; } 1014private static partial Regex OpenSslCertificateExtensionRegex { get; }
Certificates\CertificateHelpers.cs (1)
134internal static partial Regex OpenSslVersionRegex();
Commands\DocsGetCommand.cs (4)
119private static partial System.Text.RegularExpressions.Regex HeadingRegex(); 122private static partial System.Text.RegularExpressions.Regex CodeBlockStartRegex(); 125private static partial System.Text.RegularExpressions.Regex CodeBlockEndRegex(); 128private static partial System.Text.RegularExpressions.Regex ExcessiveNewlinesRegex();
Commands\NewCommand.cs (2)
453internal static partial Regex GetProjectNameRegex(); 462var regex = GetProjectNameRegex();
Mcp\Docs\DocsIndexService.cs (3)
578private static partial Regex TokenSplitRegex(); 582private static partial Regex CodeBlockRegex(); 586private static partial Regex IdentifierRegex();
Projects\FallbackProjectParser.cs (2)
22private static partial Regex SdkDirectiveRegex(); 25private static partial Regex PackageDirectiveRegex();
Projects\ProjectUpdater.cs (1)
595internal static partial Regex SdkDirectiveRegex();
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();
Utils\ConsoleActivityLogger.cs (1)
459return Regex.Replace(
Utils\EnvironmentChecker\ContainerRuntimeCheck.cs (1)
425private static partial Regex VersionRegex();
Utils\EnvironmentChecker\WslEnvironmentCheck.cs (1)
97var kernelVersionMatch = Regex.Match(version, @"Linux\s+version\s+(\d+)\.", RegexOptions.IgnoreCase);
Utils\MarkdownToSpectreConverter.cs (17)
169var regex = new Regex(@"^>\s*(.*)$"); 215var spectreRegex = new Regex(spectrePattern); 237private static partial Regex HeaderLevel6Regex(); 240private static partial Regex HeaderLevel5Regex(); 243private static partial Regex HeaderLevel4Regex(); 246private static partial Regex HeaderLevel3Regex(); 249private static partial Regex HeaderLevel2Regex(); 252private static partial Regex HeaderLevel1Regex(); 255private static partial Regex BoldDoubleAsterisksRegex(); 258private static partial Regex BoldDoubleUnderscoresRegex(); 261private static partial Regex ItalicSingleAsteriskRegex(); 264private static partial Regex ItalicSingleUnderscoreRegex(); 267private static partial Regex StrikethroughRegex(); 270private static partial Regex CodeBlockRegex(); 273private static partial Regex InlineCodeRegex(); 276private static partial Regex ImageRegex(); 279private static partial Regex LinkRegex();
Utils\StringUtils.cs (1)
16private static partial Regex RemoveSpectreFormattingRegex();
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 (1)
McpDocsE2ETests.cs (1)
314private static partial Regex SlugRegex();
Aspire.Cli.Tests (3)
Mcp\E2E\McpDocsE2ETests.cs (1)
310private static partial Regex SlugRegex();
Mcp\ListConsoleLogsToolTests.cs (1)
205var match = Regex.Match(text, @"```plaintext\s*(.*?)\s*```", RegexOptions.Singleline);
Projects\ProjectUpdaterTests.cs (1)
2246var regex = ProjectUpdater.SdkDirectiveRegex();
Aspire.Confluent.Kafka.Tests (1)
KafkaContainerFixture.cs (1)
86private static partial Regex KafkaReadyRegex();
Aspire.Dashboard (14)
Components\Layout\MobileNavMenu.razor.cs (2)
108private static Regex GetNonIndexPageRegex(string pageRelativeBasePath) 110pageRelativeBasePath = Regex.Escape(pageRelativeBasePath);
Components\Layout\MobileNavMenuEntry.cs (1)
9internal record MobileNavMenuEntry(string Text, Func<Task> OnClick, Icon? Icon = null, Regex? LinkMatchRegex = null);
Model\ConnectionStringParser.cs (2)
57private static partial Regex HostPortRegex(); 64private static partial Regex JdbcUrlRegex();
Model\ResourceOutgoingPeerResolver.cs (1)
19private 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)
19private static partial Regex NonAlphanumericRegex();
Aspire.Dashboard.Tests (5)
ConsoleLogsTests\UrlParserTests.cs (2)
101var regex = UrlParser.GenerateUrlRegEx(); 114var regex = UrlParser.GenerateUrlRegEx();
Markdown\MarkdownProcessorTests.cs (2)
51var count = Regex.Matches(html, Regex.Escape("code-block")).Count;
VersionHelpersTests.cs (1)
13private static readonly Regex s_versionRegex = new Regex(@"^\d+\.\d+\.\d+(-[A-Za-z0-9\.\-]+)?$");
Aspire.EndToEnd.Tests (3)
tests\Shared\TemplatesTesting\AspireProject.cs (2)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<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 (9)
Dashboard\DashboardService.cs (1)
35private static partial Regex ApplicationNameRegex();
Dcp\DcpDependencyCheck.cs (1)
19private static partial Regex VersionRegex();
Dcp\DcpExecutor.cs (1)
62private static partial Regex ApplicationNameRegex();
Dcp\Model\ModelCommon.cs (1)
247bool isValid = Regex.IsMatch(candidate, @"^[[a-zA-Z_~][a-zA-Z0-9\-._~]*$");
Pipelines\Internal\FileDeploymentStateManager.cs (1)
27private static partial Regex ValidEnvironmentNameRegex();
src\Shared\ConsoleLogs\TimestampParser.cs (1)
71private static partial Regex GenerateRfc3339RegEx();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
src\Shared\InteractionHelpers.cs (1)
19private static partial Regex NonAlphanumericRegex();
Utils\ContainerReferenceParser.cs (1)
40private static partial Regex ImageNameRegex();
Aspire.Hosting.Azure (1)
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
47private static partial Regex ResourceGroupValidCharacters();
Aspire.Hosting.Azure.KeyVault (1)
AzureKeyVaultResourceExtensions.cs (1)
374private static partial Regex AzureKeyVaultSecretNameRegex();
Aspire.Hosting.DevTunnels (3)
DevTunnelResourceBuilderExtensions.cs (2)
830private static partial Regex TunnelIdRegex(); 833private static partial Regex LabelRegex();
src\Shared\EnvironmentVariableNameEncoder.cs (1)
14private static partial Regex ValidNameRegex();
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
22private static readonly Regex s_exportIdPattern = new(
Aspire.Hosting.Kubernetes (4)
Extensions\HelmExtensions.cs (4)
120internal static partial Regex HelmFlowControlPattern(); 123private static partial Regex EndWithNonStringTypePattern(); 126internal static partial Regex ScalarExpressionPattern(); 129internal static partial Regex ExpressionPattern();
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.Redis.Tests (1)
AddRedisTests.cs (1)
921var match = Regex.Match(valueExpression, @"\{(cond-[^.]+)\.connectionString\}");
Aspire.Hosting.SqlServer (1)
SqlServerBuilderExtensions.cs (1)
23internal static partial Regex GoStatements();
Aspire.Hosting.Tests (7)
DistributedApplicationTests.cs (4)
1649var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1665var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}")); 1722var redisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redis-{ReplicaIdRegex}")); 1739var otherRedisContainer = Assert.Single(list, c => Regex.IsMatch(c.Name(), $"{testName}-redisNoPort-{ReplicaIdRegex}"));
Helpers\KubernetesHelper.cs (1)
34if (Regex.IsMatch(name, resourceNamePattern) && ready(r))
ProjectResourceTests.cs (1)
869.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.Playground.Tests (1)
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 to the dashboard at (?<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");
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)
1608private static partial Regex TimeSpanRegex();
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
dotnet (14)
_generated\187\RegexGenerator.g.cs (8)
34private static partial global::System.Text.RegularExpressions.Regex GetFrameRegex() => global::System.Text.RegularExpressions.Generated.GetFrameRegex_0.Instance; 50/// <summary>Custom <see cref="Regex"/>-derived type for the GetFrameRegex 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> 429/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 433/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 434internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 437internal 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)
59private static partial Regex GetFrameRegex();
Commands\Test\VSTest\TestCommand.cs (1)
669private static readonly Regex[] TerminalsRegexes =
Extensions\ParseResultExtensions.cs (1)
65Regex.Split(formatString, @"{[0-9]+}");
Telemetry\MacAddressGetter.cs (2)
47foreach (Match match in Regex.Matches(shelloutput, MacRegex, RegexOptions.IgnoreCase)) 49if (!Regex.IsMatch(match.Value, ZeroRegex))
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)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
925private static partial Regex OpenSslVersionRegex { get; } 1007private static partial Regex OpenSslHashFilenameRegex { get; } 1014private 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 (20)
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));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
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)
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
Microsoft.Agents.AI.ProjectTemplates.Tests (7)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.AspNetCore.App.Analyzers (2)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (2)
24private readonly Regex _regex; 28var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
Microsoft.AspNetCore.Components (14)
_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;
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.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)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
925private static partial Regex OpenSslVersionRegex { get; } 1007private static partial Regex OpenSslHashFilenameRegex { get; } 1014private static partial Regex OpenSslCertificateExtensionRegex { get; }
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.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)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
925private static partial Regex OpenSslVersionRegex { get; } 1007private static partial Regex OpenSslHashFilenameRegex { get; } 1014private static partial Regex OpenSslCertificateExtensionRegex { get; }
Microsoft.Build (155)
_generated\0\RegexGenerator.g.cs (96)
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; 843internal static partial global::System.Text.RegularExpressions.Regex ItemMetadataRegex => global::System.Text.RegularExpressions.Generated.ItemMetadataRegex_20.Instance; 979internal static partial global::System.Text.RegularExpressions.Regex NonTransformItemMetadataRegex => global::System.Text.RegularExpressions.Generated.NonTransformItemMetadataRegex_21.Instance; 1000private static partial global::System.Text.RegularExpressions.Regex XmlnsPattern => global::System.Text.RegularExpressions.Generated.XmlnsPattern_22.Instance; 1016/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression method.</summary> 1037/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1040/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1869/// <summary>Custom <see cref="Regex"/>-derived type for the OriginCategoryCodeTextExpression2 method.</summary> 1890/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1893/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2227/// <summary>Custom <see cref="Regex"/>-derived type for the FilenameLocationFromOrigin method.</summary> 2248/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2251/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2524/// <summary>Custom <see cref="Regex"/>-derived type for the LineFromLocation method.</summary> 2545/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2548/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2646/// <summary>Custom <see cref="Regex"/>-derived type for the LineLineFromLocation method.</summary> 2667/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2670/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2801/// <summary>Custom <see cref="Regex"/>-derived type for the LineColFromLocation method.</summary> 2822/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2825/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2956/// <summary>Custom <see cref="Regex"/>-derived type for the LineColColFromLocation method.</summary> 2977/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2980/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3140/// <summary>Custom <see cref="Regex"/>-derived type for the LineColLineColFromLocation method.</summary> 3161/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3164/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3353/// <summary>Custom <see cref="Regex"/>-derived type for the SectionMatcherRegex method.</summary> 3372/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3375/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 3768/// <summary>Custom <see cref="Regex"/>-derived type for the PropertyMatcherRegex method.</summary> 3787/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 3790/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4212/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerArgPattern method.</summary> 4233/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4236/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4514/// <summary>Custom <see cref="Regex"/>-derived type for the VerbosityArgPattern method.</summary> 4535/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4538/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4759/// <summary>Custom <see cref="Regex"/>-derived type for the TerminalLoggerParametersArgPattern method.</summary> 4780/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 4783/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 4997/// <summary>Custom <see cref="Regex"/>-derived type for the ConsoleLoggerParametersArgPattern method.</summary> 5018/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5021/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5235/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRegex method.</summary> 5256/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5259/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5629/// <summary>Custom <see cref="Regex"/>-derived type for the ItemVectorTransformRawRegex method.</summary> 5648/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5651/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 5941/// <summary>Custom <see cref="Regex"/>-derived type for the XmlDeclarationRegex method.</summary> 5960/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 5963/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6149/// <summary>Custom <see cref="Regex"/>-derived type for the CrackProjectLineRegex method.</summary> 6170/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6173/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6619/// <summary>Custom <see cref="Regex"/>-derived type for the CrackPropertyLineRegex method.</summary> 6640/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6643/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 6886/// <summary>Custom <see cref="Regex"/>-derived type for the RegistrySdkRegex method.</summary> 6905/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 6908/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 7057/// <summary>Custom <see cref="Regex"/>-derived type for the ItemMetadataRegex method.</summary> 7078/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 7081/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 7349/// <summary>Custom <see cref="Regex"/>-derived type for the NonTransformItemMetadataRegex method.</summary> 7370/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 7373/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 9210/// <summary>Custom <see cref="Regex"/>-derived type for the XmlnsPattern method.</summary> 9229/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 9232/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 9335/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary> 9339/// <summary>Default timeout value set in <see cref="AppContext"/>, or <see cref="Regex.InfiniteMatchTimeout"/> if none was set.</summary> 9340internal static readonly TimeSpan s_defaultTimeout = AppContext.GetData("REGEX_DEFAULT_MATCH_TIMEOUT") is TimeSpan timeout ? timeout : Regex.InfiniteMatchTimeout; 9343internal 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)
193var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Evaluation\Expander.cs (8)
3467internal static partial Regex ItemMetadataRegex { get; } 3502internal static partial Regex NonTransformItemMetadataRegex { get; } 3535/// Copied from <see cref="Regex.Replace(string, MatchEvaluator, int, int)"/> and modified to use a <see cref="SpanBasedStringBuilder"/> rather than repeatedly allocating a <see cref="System.Text.StringBuilder"/>. This 3542/// <param name="regex">The <see cref="Regex"/> that will perform the matching.</param> 3543public static void ReplaceAndAppend(string input, Func<Match, MetadataMatchEvaluator, string> evaluator, MetadataMatchEvaluator metadataMatchEvaluator, SpanBasedStringBuilder stringBuilder, Regex regex) 3549/// Copied from <see cref="Regex.Replace(string, MatchEvaluator, int, int)"/> and modified to use a <see cref="SpanBasedStringBuilder"/> rather than repeatedly allocating a <see cref="System.Text.StringBuilder"/>. This 3558/// <param name="regex">The <see cref="Regex"/> that will perform the matching.</param> 3559public static void ReplaceAndAppend(string input, Func<Match, MetadataMatchEvaluator, string> evaluator, MetadataMatchEvaluator matchEvaluatorState, int count, int startat, SpanBasedStringBuilder stringBuilder, Regex regex)
Evaluation\Expander\WellKnownFunctions.cs (3)
908else if (receiverType == typeof(Regex)) 910if (string.Equals(methodName, nameof(Regex.Replace), StringComparison.OrdinalIgnoreCase) && args.Length == 3) 914returnVal = Regex.Replace(arg1, arg2, arg3);
Evaluation\IntrinsicFunctions.cs (1)
47private static partial Regex RegistrySdkRegex { get; }
Globbing\MSBuildGlob.cs (7)
35public Regex Regex { get; } 37public GlobState(string globRoot, string fileSpec, bool isLegal, string fixedDirectoryPart, string wildcardDirectoryPart, string filenamePart, bool needsRecursion, Regex regex) 51private static readonly WeakValueDictionary<string, Regex> s_regexCache = new WeakValueDictionary<string, Regex>(); 58internal Regex TestOnlyRegex => _state.Value.Regex; 199Regex regex = null; 218Regex 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 (1)
310availableStaticMethods.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; 565private static List<Regex> PopulateRegexFromEnvironment() 570return new List<Regex>(0); 574List<Regex> regexes = new List<Regex>(); 577Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Utilities\FileSpecMatchTester.cs (5)
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)
52private static partial Regex ItemVectorTransformRegex { get; } 55private static partial Regex ItemVectorTransformRawRegex { get; }
Utilities\Utilities.cs (1)
312private static partial Regex XmlnsPattern { get; }
Microsoft.Build.Framework (21)
_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)
166Regex.IsMatch(processName, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 240Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
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)
54private static readonly Lazy<ConcurrentDictionary<string, (Regex regex, bool needsRecursion, bool isLegalFileSpec)>> s_regexCache = new(() =>new(StringComparer.Ordinal)); 755Regex regexFileMatch, // can be null 778public Regex RegexFileMatch { get; } 1500out Regex regexFileMatch, 1522out Regex regexFileMatch, 1528GetFileSpecInfoWithRegexObjectCore(spec, out var regex, out var needsRec, out var isLegal); 1852Regex regexFileMatch; 1874Regex 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)
428match = 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)
644private 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, 119var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled)); 246sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 356sb.Append(Regex.Escape(currentChar.ToString()));
Diagnostic\DiagnosticInfo.cs (1)
134var matches = Regex.Matches(message, @"\{\d+[}:]");
SourceGeneration\AdditionalSourcesCollection.cs (1)
28private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (21)
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (4)
351if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase) || 352Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 356else if (Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase) || 357Regex.IsMatch(lineText, ReleaseTrackingHelper.TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
MetaAnalyzers\ReleaseTrackingHelper.cs (4)
120if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 131if (Regex.IsMatch(lineText, TableHeaderNewOrRemovedRulesLine2RegexPattern, RegexOptions.IgnoreCase)) 140if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine1RegexPattern, RegexOptions.IgnoreCase)) 151if (Regex.IsMatch(lineText, TableHeaderChangedRulesLine2RegexPattern, RegexOptions.IgnoreCase))
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.AnalyzerUtilities (13)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.CodeStyle (14)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Features (3)
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.CSharp.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.Features (14)
CodeFixes\Configuration\ConfigurationUpdater.cs (3)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr);
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (2)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); 117var result = Regex.Replace(numericText, $"(.{{{interval}}})", "_$1", RegexOptions.RightToLeft);
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (2)
23private readonly Regex _regex; 27var namePortion = string.Join("|", identifiers.Select(n => $"({Regex.Escape(n)})"));
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
207private static readonly Regex s_validNumberRegex =
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (4)
37var regexType = compilation.GetTypeByMetadataName(typeof(Regex).FullName!); 49/// Finds public, static methods in <see cref="Regex"/> that have a parameter called 50/// 'pattern'. These are helpers (like <see cref="Regex.Replace(string, string, string)"/> 118if (syntaxFacts.StringComparer.Compare(nameof(Regex), name) == 0)
src\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.ResxSourceGenerator (15)
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));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Microsoft.CodeAnalysis.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 (21)
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)
422var regex = RenameUtilities.GetRegexForMatch(renameText);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (7)
TextFieldParser.cs (7)
29private readonly Regex _delimiterRegex; 33public QuoteDelimitedFieldBuilder(Regex delimiterRegex, string spaceChars) 147private Regex _delimiterRegex; 149private Regex _delimiterWithEndCharsRegex; 153private Regex _beginQuotesRegex; 301private Regex BeginQuotesRegex 1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.Data.Analysis.Tests (7)
src\Microsoft.Data.Analysis\TextFieldParser.cs (7)
29private readonly Regex _delimiterRegex; 33public QuoteDelimitedFieldBuilder(Regex delimiterRegex, string spaceChars) 147private Regex _delimiterRegex; 149private Regex _delimiterWithEndCharsRegex; 153private Regex _beginQuotesRegex; 301private Regex BeginQuotesRegex 1005string escapedDelimiter = Regex.Escape(_delimiters[i]);
Microsoft.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( 235string 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)
97Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Build.Tasks.Workloads (2)
Utils.cs (1)
109string escapedPattern = Regex.Escape(wildcardPattern).Replace(@"\*", ".*").Replace(@"\?", ".");
WorkloadPackageBase.cs (1)
258if (exclusionPatterns.Any(pattern => Regex.IsMatch(file, pattern)))
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
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 (3)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
251public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 253public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 255public 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 (4)
ChatCompletion\ChatResponseFormat.cs (1)
98private static partial Regex InvalidNameCharsRegex();
Functions\AIFunctionFactory.cs (3)
1159private static partial Regex PotentiallyJsonRegex(); 1203private static partial Regex CompilerGeneratedNameRegex(); 1213private static partial Regex InvalidNameCharsRegex();
Microsoft.Extensions.AI.Evaluation (10)
Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Console (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Quality (1)
EvaluationMetricExtensions.cs (1)
104Match match = Regex.Match(text, $@"<{tagName}>(?<value>.*?)</{tagName}>", Options);
Microsoft.Extensions.AI.Evaluation.Reporting (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (1)
SerializationChainingTests.cs (1)
52jsonFromElement = Regex.Replace(jsonFromElement, @"\s+", "");
Microsoft.Extensions.AI.Evaluation.Safety (10)
src\Libraries\Microsoft.Extensions.AI.Evaluation\Utilities\ModelInfo.cs (10)
35private static Regex LocalMachineHostMonikerRegex { get; } = 36new Regex($"\\({Regex.Escape(KnownModelHostMonikers.LocalMachine)}\\)$"); 51private static Regex KnownHostMonikersRegex { get; } = 54$"{Regex.Escape(KnownModelHostMonikers.AzureAIFoundry)}|" + 55$"{Regex.Escape(KnownModelHostMonikers.AzureOpenAI)}|" + 56$"{Regex.Escape(KnownModelHostMonikers.AzureML)}|" + 57$"{Regex.Escape(KnownModelHostMonikers.GitHubModels)}|" + 58$"{Regex.Escape(KnownModelHostMonikers.Azure)}|" + 59$"{Regex.Escape(KnownModelHostMonikers.GitHub)}|" + 60$"{Regex.Escape(KnownModelHostMonikers.Microsoft)}" +
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
596Regex.IsMatch(response.Text ?? "", @"\b(3|three)\b", RegexOptions.IgnoreCase),
VerbatimHttpHandler.cs (1)
99return Regex.Replace(text, @"\s*", string.Empty);
VerbatimMultiPartHttpHandler.cs (2)
148return Regex.Replace(input, @"[^a-zA-Z0-9_ .,!?\r\n""=;\//\[\]-]", ""); 190Regex.Replace(text, @"\s*", string.Empty);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
859private static Regex InvalidAuthorNameRegex() => _invalidAuthorNameRegex; 860private static readonly Regex _invalidAuthorNameRegex = new(InvalidAuthorNamePattern, RegexOptions.Compiled);
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIAssistantChatClientIntegrationTests.cs (1)
125var matches = Regex.Matches(listing, @"thread_\w+");
OpenAIConversionTests.cs (1)
1738private static string RemoveWhitespace(string input) => Regex.Replace(input, @"\s+", "");
Microsoft.Extensions.AI.Templates.Tests (7)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.Extensions.AI.Tests (3)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
991private static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Image\OpenTelemetryImageGeneratorTests.cs (1)
166static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (1)
148static string ReplaceWhitespace(string? input) => Regex.Replace(input ?? "", @"\s+", " ").Trim();
Microsoft.Extensions.Http.Diagnostics (2)
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
19public static partial Regex MakeRouteRegex();
Http\HttpDependencyMetadataResolver.cs (1)
33private static readonly Regex _routeRegex = DownstreamDependencyMetadataManagerRegex.MakeRouteRegex();
Microsoft.Gen.BuildMetadata.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Logging.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Maui.Controls (4)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
WebView\WebView.cs (3)
302 var singleQuotes = Regex.Matches(js, @"(\\*?)'"); 324 js = Regex.Replace(js, @"(?<=[^\\])" + Regex.Escape(match), replacementStr);
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
12 static readonly Regex rxResourceFilenameValidation
Microsoft.McpServer.ProjectTemplates.Tests (7)
test\ProjectTemplates\Infrastructure\TemplateTestUtilities.cs (6)
39.Select(arg => Regex.Replace(arg, @"-(?:f|-[Ff]ramework)=(net[0-9]+)\.0", "$1")) 40.Select(arg => Regex.Replace(arg, "--(.*?)=true", "$1_T")) 41.Select(arg => Regex.Replace(arg, "--(.*?)=false", "$1_F")) 42.Select(arg => Regex.Replace(arg, "--(.*?)=(.*)", "$2")) 43.Select(arg => Regex.Replace(arg, "--(.*)", "$1")) 44.Select(arg => Regex.Replace(arg, @"\W", ""))
test\ProjectTemplates\Infrastructure\VerifyScrubbers.cs (1)
96string finalOutput = Regex.Replace(output.ToString(), pattern, replacement, regexOptions);
Microsoft.ML.AutoML (1)
ColumnInference\ColumnTypeInference.cs (1)
219if (Regex.IsMatch(v, candidate, RegexOptions.IgnoreCase))
Microsoft.ML.CodeGenerator (3)
Templates\Azure\Console\AzureModelBuilder.cs (1)
59this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Templates\Console\ModelBuilder.cs (2)
65this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString()))); 77this.Write(this.ToStringHelper.ToStringWithCulture(Regex.Escape(Separator.ToString())));
Microsoft.ML.Core (2)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Utilities\Utils.cs (1)
589return Regex.Replace(value, "[^A-Za-z0-9]", "");
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
337var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (5)
Commands\EvaluateCommand.cs (2)
50private readonly Regex _loadNamePattern; 55bool isVector = false, Regex namePattern = null, string groupName = null, string nameFormat = null)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.StandardTrainers (1)
Standard\LinearPredictorUtils.cs (1)
86name = Regex.Replace(name, @"[^\w\d_]", "_");
Microsoft.ML.Sweeper (1)
Parameters.cs (1)
560string[] minMaxRegex = Regex.Split(paramValue, "(?<=[^eE])-");
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tests (3)
OnnxConversionTest.cs (2)
451fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\""); 2290fileText = Regex.Replace(fileText, "\"producerVersion\": \".*\"", "\"producerVersion\": \"##VERSION##\"");
Transformers\TextFeaturizerTests.cs (1)
367var expected = Regex.Replace(data[0].A, "[,|_|'|\"|;|\\.]", "");
Microsoft.ML.Tokenizers (52)
Model\SentencePieceBaseModel.cs (2)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 62internal Regex? SpecialTokensRegex { get; }
Model\TiktokenTokenizer.cs (8)
1197private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(string modelName) => GetTiktokenConfigurations(GetModelEncoding(modelName), modelName); 1199private static (Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) GetTiktokenConfigurations(ModelEncoding modelEncoding, string? modelName = null) 1269private static partial Regex Cl100kBaseRegex(); 1272internal static partial Regex P50kBaseRegex(); 1275internal static partial Regex O200kBaseRegex(); 1299(Dictionary<string, int> SpecialTokens, Regex Regex, string VocabFile, Type? DataType, string PackageName) tiktokenConfiguration = GetTiktokenConfigurations(modelEncoding, modelName); 1459(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName); 1499(Dictionary<string, int> SpecialTokens, Regex Regex, string _, Type? __, string ___) tiktokenConfiguration = GetTiktokenConfigurations(modelName);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\PreTokenizer.cs (8)
32internal static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex) 50private static partial Regex WhiteSpaceOrPunctuationRegex(); 79private static partial Regex WordOrNonWordRegex(); 109private static partial Regex WhiteSpaceRegex(); 133internal static IEnumerable<(int Offset, int Length)> SplitText(ReadOnlySpan<char> text, Regex regex) 140static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, int textLength) 157internal static bool TryGetMatch(Regex regex, string text, int beginning, int length, out (int offset, int length) match) 178internal static bool TryGetMatch(Regex regex, scoped ReadOnlySpan<char> text, int beginning, int length, out (int offset, int length) match)
PreTokenizer\RegexPreTokenizer.cs (8)
18private readonly Regex? _specialTokensRegex; 19private readonly Regex _regex; 27public RegexPreTokenizer(Regex regex, IReadOnlyDictionary<string, int>? specialTokens) 39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled); 57static IEnumerable<(int Offset, int Length)> SplitText(string text, Regex regex, Regex? specialTokensRegex) 108static IEnumerable<(int Offset, int Length)> SplitText(char[] text, Regex regex, Regex? specialTokensRegex, int textLength)
RegexGenerator.g.cs (25)
50private static partial global::System.Text.RegularExpressions.Regex Cl100kBaseRegex() => global::System.Text.RegularExpressions.Generated.Cl100kBaseRegex_0.Instance; 91internal static partial global::System.Text.RegularExpressions.Regex P50kBaseRegex() => global::System.Text.RegularExpressions.Generated.P50kBaseRegex_1.Instance; 155internal static partial global::System.Text.RegularExpressions.Regex O200kBaseRegex() => global::System.Text.RegularExpressions.Generated.O200kBaseRegex_2.Instance; 174private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceOrPunctuationRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceOrPunctuationRegex_3.Instance; 193private static partial global::System.Text.RegularExpressions.Regex WordOrNonWordRegex() => global::System.Text.RegularExpressions.Generated.WordOrNonWordRegex_4.Instance; 210private static partial global::System.Text.RegularExpressions.Regex WhiteSpaceRegex() => global::System.Text.RegularExpressions.Generated.WhiteSpaceRegex_5.Instance; 226/// <summary>Custom <see cref="Regex"/>-derived type for the Cl100kBaseRegex method.</summary> 244/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 247/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 676/// <summary>Custom <see cref="Regex"/>-derived type for the P50kBaseRegex method.</summary> 694/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 697/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1050/// <summary>Custom <see cref="Regex"/>-derived type for the O200kBaseRegex method.</summary> 1068/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1071/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 1885/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceOrPunctuationRegex method.</summary> 1903/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 1906/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2015/// <summary>Custom <see cref="Regex"/>-derived type for the WordOrNonWordRegex method.</summary> 2033/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2036/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2148/// <summary>Custom <see cref="Regex"/>-derived type for the WhiteSpaceRegex method.</summary> 2166/// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see cref="Regex"/>.</summary> 2169/// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</summary> 2250/// <summary>Helper methods used by generated <see cref="Regex"/>-derived implementations.</summary>
Microsoft.NET.Build.Containers (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)
30private 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) 127if (!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)
121Regex.Replace(jsModuleCandidatePath, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
MergeConfigurationProperties.cs (1)
97metadataValue = Regex.Replace(metadataValue, ";{2,}", ";");
OverrideHtmlAssetPlaceholders.cs (3)
40internal static readonly Regex _assetsRegex = new Regex(@"""(?<fileName>[^""]+)#\[\.{fingerprint}\](?<fileExtension>[^""]+)"""); 42internal static readonly Regex _importMapRegex = new Regex(@"<script\s+type=""importmap""\s*>\s*</script>"); 44internal static readonly Regex _preloadRegex = new Regex(@"<link\s+rel=""preload""(\s+id=""(?<group>[^""]+)"")?\s*[/]?>");
ScopedCss\ApplyCssScopes.cs (1)
127Regex.Replace(scopedCssCandidate.ItemSpec, candidateMatchPattern, replacementExpression, RegexOptions.IgnoreCase);
ScopedCss\RewriteCss.cs (1)
27private static readonly Regex s_deepCombinatorRegex = new($@"^{DeepCombinatorText}\s*", RegexOptions.None, s_regexTimeout);
UpdateExternallyDefinedStaticWebAssets.cs (5)
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.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 (2)
FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
FilterExpression.cs (1)
191var invalidInput = Regex.Match(filterString, @"\(\s*\)");
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 (3)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FastFilter.cs (1)
60internal Regex? PropertyValueRegex { get; set; }
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpression.cs (1)
191var invalidInput = Regex.Match(filterString, @"\(\s*\)");
Utilities\RunSettingsProviderExtensions.cs (1)
99Regex regex = new($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)");
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (2)
Utility\TrxFileHelper.cs (1)
27private static readonly Regex ReservedFileNamesRegex = new(@"(?i:^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9]|CLOCK\$)(\..*)?)$");
XML\XmlPersistence.cs (1)
683return Regex.Replace(str, invalidChar, evaluator);
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)
383responseFileLine = 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)
347var 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);
PlatformDocAnalyzer (2)
PlatformDocAnalyzer.cs (2)
29private static readonly Regex s_memberRegex = new(@"<member\s+name=""([^""]+)"">(.*?)</member>", RegexOptions.Singleline | RegexOptions.Compiled); 30private static readonly Regex s_whitespaceRegex = new(@"\s+", RegexOptions.Compiled);
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)
112if (!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)
279var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout); 298var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (3)
925private static partial Regex OpenSslVersionRegex { get; } 1007private static partial Regex OpenSslHashFilenameRegex { get; } 1014private static partial Regex OpenSslCertificateExtensionRegex { get; }
Roslyn.Diagnostics.Analyzers (13)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\AdditionalFileProvider.cs (1)
51=> _additionalFiles.Where(x => Regex.IsMatch(Path.GetFileName(x.Path), pattern, RegexOptions.IgnoreCase));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (8)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled); 21private Regex Regex { get; } 24Regex regex, 130Regex pattern, 174Regex pattern, 217Regex pattern,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (2)
83sb.Append(Regex.Escape(lexer.EatCurrentCharacter().ToString())); 229sb.Append(Regex.Escape(currentChar.ToString()));
Roslyn.Diagnostics.CSharp.Analyzers (1)
src\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)
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)
2682private static partial Regex EnsureArrayIndexRegex { get; } 2685private static partial Regex P0Regex { get; } 3496private static partial Regex UnknownNodeNullAnyTypeRegex { get; } 3499private static partial Regex UnknownNodeObjectEmptyRegex { get; } 3502private static partial Regex UnknownNodeObjectNullRegex { get; } 3505private static partial Regex UnknownNodeObjectRegex { get; } 3508private 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)
267public static partial Regex IntegerRegex { get; }
System.Text.RegularExpressions (175)
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 (15)
24/// The <see cref="Regex"/> class represents the .NET regular expression engine. 69/// <summary>Initializes a new instance of the <see cref="Regex" /> class.</summary> 84/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression. 95/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 111/// Initializes a new instance of the <see cref="Regex" /> class for the specified regular expression, 234/// <summary>Initializes a new instance of the <see cref="Regex" /> class by using serialized data.</summary> 237/// <exception cref="PlatformNotSupportedException">Serialization of <see cref="Regex" /> objects is not supported.</exception> 289/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly. 299/// Compiles one or more specified <see cref="Regex" /> objects to a named assembly with the specified attributes. 309/// Compiles one or more specified <see cref="Regex" /> objects and a specified resource file 407/// <summary>Gets the options that were passed into the <see cref="Regex" /> constructor.</summary> 410/// to the <see cref="Regex" /> constructor. 427/// <summary>Returns the regular expression pattern that was passed into the <see cref="Regex" /> constructor.</summary> 429/// The pattern that was passed into the <see cref="Regex" /> constructor. 551/// 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 534/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 579/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 606/// <param name="matchTimeout">A time-out interval, or <see cref="Regex.InfiniteMatchTimeout"/> to indicate 628/// The static <c>Matches</c> methods are equivalent to constructing a <see cref="Regex"/> object with 675/// <see cref="Regex.MatchTimeout"/> property is not <see cref="Regex.InfiniteMatchTimeout"/> and a 724/// <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();
tlens (1)
src\runtime\src\tools\illink\external\Mono.Options\Options.cs (1)
1177private readonly Regex ValueOption = new Regex(
vstest.console (3)
Internal\MSBuildLogger.cs (3)
191var stackFrames = Regex.Split(result.ErrorStackTrace, Environment.NewLine); 381private static Regex? s_regex; 394string[] 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); 381private static Regex? s_regex; 394string[] stackFrames = Regex.Split(errorStackTrace, Environment.NewLine);