1591 references to RegexOptions
AnalyzerRunner (2)
Options.cs (2)
162var expression = new Regex(arg.Substring("/editperf:".Length), RegexOptions.Compiled | RegexOptions.IgnoreCase);
Aspire.Dashboard (8)
Components\Layout\MobileNavMenu.razor.cs (2)
100return new Regex($"^({pageRelativeBasePath}|{pageRelativeBasePath}/.+)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
ConsoleLogs\UrlParser.cs (3)
72RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.ExplicitCapture)]
src\Shared\ConsoleLogs\TimestampParser.cs (3)
70RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace)]
Aspire.EndToEnd.Tests (1)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
Aspire.Hosting (7)
Dashboard\DashboardService.cs (4)
32[GeneratedRegex("""^(?<name>.+?)\.?AppHost$""", RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant)]
src\Shared\ConsoleLogs\TimestampParser.cs (3)
70RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace)]
Aspire.Microsoft.Data.SqlClient (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Microsoft.EntityFrameworkCore.SqlServer (2)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\SqlClientTraceInstrumentationOptions.cs (2)
41private static readonly Regex DataSourceRegex = new("^(.*\\s*:\\s*\\\\{0,2})?(.*?)\\s*(?:[\\\\,]|$)\\s*(.*?)\\s*(?:,|$)\\s*(.*)$", RegexOptions.Compiled); 50private static readonly Regex NamedPipeRegex = new("pipe\\\\MSSQL\\$(.*?)\\\\", RegexOptions.Compiled);
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\AspireProject.cs (1)
19private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
BuildActionTelemetryTable (1)
Program.cs (1)
559(?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace);
dotnet-dev-certs (2)
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);
dotnet-svcutil-lib (2)
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);
dotnet-svcutil-lib.Tests (3)
FixupUtil.cs (3)
149var regexOptions = ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None;
IIS.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\IIS.Shared.FunctionalTests\ApplicationInitializationTests.cs (1)
71var expectedRegex = new Regex(EventLogHelpers.ShutdownMessage(result), RegexOptions.Singleline);
IIS.LongTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewHandler.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.NewShim.FunctionalTests (2)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
IIS.ShadowCopy.Tests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
IISExpress.FunctionalTests (4)
src\Servers\IIS\IIS\test\Common.FunctionalTests\Infrastructure\EventLogHelpers.cs (1)
65var expectedRegex = new Regex(regexString, RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.FunctionalTests\LoggingTests.cs (2)
320var processIdPattern = new Regex("Process Id: (\\d+)\\.", RegexOptions.Singleline); 355var prefixPattern = new Regex(@"\[(.{24}), PID: (\d+)\]", RegexOptions.Singleline);
src\Servers\IIS\IIS\test\Common.LongTests\StartupTests.cs (1)
1516var expectedRegex = new Regex("Exception Info: System\\.InvalidOperationException:", RegexOptions.Singleline);
Microsoft.AspNetCore.App.Analyzers (3)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (3)
30RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.AspNetCore.App.Analyzers.Test (2)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
50RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
Microsoft.AspNetCore.Components (8)
src\Http\Routing\src\Constraints\RegexInlineRouteConstraint.cs (2)
25public RegexInlineRouteConstraint([StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase)] string regexPattern)
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (6)
46[StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase)] 55RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase,
Microsoft.AspNetCore.Components.Endpoints.Tests (8)
EndpointHtmlRendererTest.cs (8)
83var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 198var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 247var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 338var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 399var firstMatch = Regex.Match(firstComponent, PrerenderedComponentPattern, RegexOptions.Multiline); 535var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 586var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Multiline); 1170var match = Regex.Match(content, PrerenderedComponentPattern, RegexOptions.Singleline);
Microsoft.AspNetCore.Components.WebAssembly.Server (3)
DebugProxyLauncher.cs (3)
19private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$", RegexOptions.None, TimeSpan.FromSeconds(10)); 20private static readonly Regex ApplicationStartedRegex = new Regex(@"^\s*Application started\. Press Ctrl\+C to shut down\.$", RegexOptions.None, TimeSpan.FromSeconds(10)); 21private static readonly Regex NowListeningFirefoxRegex = new Regex(@"^\s*Debug proxy for firefox now listening on tcp://(?<url>.*)\. And expecting firefox at port 6000\.$", RegexOptions.None, TimeSpan.FromSeconds(10));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
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);
Microsoft.AspNetCore.Grpc.JsonTranscoding (2)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
51private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 60private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Grpc.Swagger (2)
src\Grpc\JsonTranscoding\src\Shared\Legacy.cs (2)
51private static readonly Regex TimestampRegex = new Regex(@"^(?<datetime>[0-9]{4}-[01][0-9]-[0-3][0-9]T[012][0-9]:[0-5][0-9]:[0-5][0-9])(?<subseconds>\.[0-9]{1,9})?(?<offset>(Z|[+-][0-1][0-9]:[0-5][0-9]))$", RegexOptions.Compiled); 60private static readonly Regex DurationRegex = new Regex(@"^(?<sign>-)?(?<int>[0-9]{1,12})(?<subseconds>\.[0-9]{1,9})?s$", RegexOptions.Compiled);
Microsoft.AspNetCore.Rewrite (23)
ApacheModRewrite\RuleBuilder.cs (10)
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 (4)
25var regexOptions = RegexOptions.CultureInvariant | RegexOptions.Compiled; 26regexOptions = ignoreCase ? regexOptions | RegexOptions.IgnoreCase : regexOptions;
IISUrlRewrite\UrlRewriteRuleBuilder.cs (5)
49var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout); 54var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
RedirectRule.cs (2)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
RewriteRule.cs (2)
22InitialMatch = new Regex(regex, RegexOptions.Compiled | RegexOptions.CultureInvariant, _regexTimeout);
Microsoft.AspNetCore.Routing (8)
Constraints\RegexInlineRouteConstraint.cs (2)
25public RegexInlineRouteConstraint([StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.CultureInvariant | RegexOptions.IgnoreCase)] string regexPattern)
Constraints\RegexRouteConstraint.cs (6)
46[StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase)] 55RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase,
Microsoft.AspNetCore.Server.Kestrel.Core (2)
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);
Microsoft.AspNetCore.SpaServices.Extensions (4)
AngularCli\AngularCliBuilder.cs (1)
70new Regex("Date", RegexOptions.None, RegexMatchTimeout));
AngularCli\AngularCliMiddleware.cs (1)
77new Regex("open your browser on (http\\S+)", RegexOptions.None, RegexMatchTimeout));
Npm\NodeScriptRunner.cs (1)
23private static readonly Regex AnsiColorRegex = new Regex("\x001b\\[[0-9;]*m", RegexOptions.None, TimeSpan.FromSeconds(1));
ReactDevelopmentServer\ReactDevelopmentServerMiddleware.cs (1)
91new Regex("Starting the development server", RegexOptions.None, RegexMatchTimeout));
Microsoft.Build (46)
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (2)
123RegexOptions regexOptions = RegexOptions.CultureInvariant;
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (2)
35private static readonly Regex s_sectionMatcher = new Regex(s_sectionMatcherPattern, RegexOptions.Compiled); 37private static readonly Regex s_propertyMatcher = new Regex(s_propertyMatcherPattern, RegexOptions.Compiled);
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
73RegexOptions.IgnoreCase | RegexOptions.Compiled)); 78RegexOptions.IgnoreCase | RegexOptions.Compiled)); 90RegexOptions.IgnoreCase | RegexOptions.Compiled)); 98RegexOptions.IgnoreCase | RegexOptions.Compiled)); 108RegexOptions.IgnoreCase | RegexOptions.Compiled)); 118RegexOptions.IgnoreCase | RegexOptions.Compiled)); 130RegexOptions.IgnoreCase | RegexOptions.Compiled)); 144RegexOptions.IgnoreCase | RegexOptions.Compiled));
Construction\Solution\SolutionFile.cs (2)
55RegexOptions.Compiled)); 69RegexOptions.Compiled));
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Evaluation\Expander.cs (6)
3102RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled)); 3130RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled));
Evaluation\IntrinsicFunctions.cs (1)
40private static readonly Lazy<Regex> RegistrySdkRegex = new Lazy<Regex>(() => new Regex(@"^HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Microsoft SDKs\\Windows\\v(\d+\.\d+)$", RegexOptions.IgnoreCase));
FileMatcher.cs (3)
54public const RegexOptions DefaultRegexOptions = RegexOptions.IgnoreCase; 2156matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Globbing\MSBuildGlob.cs (1)
210RegexOptions regexOptions = FileMatcher.DefaultRegexOptions;
ProjectWriter.cs (6)
48RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled)); 64RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture | RegexOptions.Compiled));
Utilities\EngineFileUtilities.cs (3)
549Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Microsoft.Build.Engine.OM.UnitTests (9)
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Construction\WhiteSpacePreservation_Tests.cs (6)
451projectContents = Regex.Replace(projectContents, @"(?<!\r)\n", "\r\n", RegexOptions.Multiline); 452updatedProject = Regex.Replace(updatedProject, @"(?<!\r)\n", "\r\n", RegexOptions.Multiline); 456projectContents = Regex.Replace(projectContents, @"\r\n", "\n", RegexOptions.Multiline); 457updatedProject = Regex.Replace(updatedProject, @"\r\n", "\n", RegexOptions.Multiline); 506var crlfCount = Regex.Matches(projectResults, @"\r\n", RegexOptions.Multiline).Count; 515Assert.Empty(Regex.Matches(projectResults, @"\r\n", RegexOptions.Multiline));
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
Microsoft.Build.Engine.UnitTests (14)
BackEnd\SdkResolverService_Tests.cs (2)
804new Regex(pair.ResolvableSdkPattern, RegexOptions.Compiled | RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(500)));
Evaluation\ExpressionShredder_Tests.cs (8)
1206private static readonly Regex s_itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1214RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1227private static readonly Regex s_itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); 1239RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture);
FileUtilitiesRegex_Tests.cs (4)
22internal static readonly Regex DrivePattern = new Regex(@"^[A-Za-z]:$", RegexOptions.Compiled); 25internal static readonly Regex StartWithDrivePattern = new Regex(@"^[A-Za-z]:", RegexOptions.Compiled); 33internal static readonly Regex StartsWithUncPattern = new Regex(s_baseUncPattern, RegexOptions.Compiled); 39RegexOptions.Compiled);
Microsoft.Build.Framework (1)
FileClassifier.cs (1)
157if (Regex.IsMatch(processName, $@".*\\MSBuild\\Current\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase))
Microsoft.Build.Tasks.CodeAnalysis (13)
CanonicalError.cs (13)
72RegexOptions.IgnoreCase 84RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); 92RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); 102RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); 112RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); 124RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace); 138RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace);
Microsoft.Build.Tasks.Core (28)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (2)
30RegexOptions.IgnoreCase | RegexOptions.Compiled));
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
73RegexOptions.IgnoreCase | RegexOptions.Compiled)); 78RegexOptions.IgnoreCase | RegexOptions.Compiled)); 90RegexOptions.IgnoreCase | RegexOptions.Compiled)); 98RegexOptions.IgnoreCase | RegexOptions.Compiled)); 108RegexOptions.IgnoreCase | RegexOptions.Compiled)); 118RegexOptions.IgnoreCase | RegexOptions.Compiled)); 130RegexOptions.IgnoreCase | RegexOptions.Compiled)); 144RegexOptions.IgnoreCase | RegexOptions.Compiled));
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
FileMatcher.cs (3)
54public const RegexOptions DefaultRegexOptions = RegexOptions.IgnoreCase; 2156matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
FindInvalidProjectReferences.cs (1)
26RegexOptions.IgnoreCase);
NativeMethods.cs (2)
1250RegexOptions.CultureInvariant | RegexOptions.Compiled);
ResolveSDKReference.cs (1)
42RegexOptions.IgnoreCase);
Microsoft.Build.Tasks.UnitTests (2)
XslTransformation_Tests.cs (2)
52private readonly Regex _surroundMatch = new Regex("surround", RegexOptions.Multiline | RegexOptions.Compiled);
Microsoft.Build.Utilities.Core (26)
AssemblyFolders\AssemblyFoldersFromConfigInfo.cs (1)
34BuildEnvironmentHelper.Instance.VisualStudioInstallRootDirectory, RegexOptions.IgnoreCase);
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
CanonicalError.cs (16)
73RegexOptions.IgnoreCase | RegexOptions.Compiled)); 78RegexOptions.IgnoreCase | RegexOptions.Compiled)); 90RegexOptions.IgnoreCase | RegexOptions.Compiled)); 98RegexOptions.IgnoreCase | RegexOptions.Compiled)); 108RegexOptions.IgnoreCase | RegexOptions.Compiled)); 118RegexOptions.IgnoreCase | RegexOptions.Compiled)); 130RegexOptions.IgnoreCase | RegexOptions.Compiled)); 144RegexOptions.IgnoreCase | RegexOptions.Compiled));
CommandLineBuilder.cs (3)
158?? (_definitelyNeedQuotes = new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant)); 164?? (_allowedUnquoted = new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant));
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
FileMatcher.cs (3)
54public const RegexOptions DefaultRegexOptions = RegexOptions.IgnoreCase; 2156matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Microsoft.Cci.Extensions (1)
Extensions\CSharp\CSharpCciExtensions.cs (1)
650s_isKeywordRegex = new Regex("^(abstract|as|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|foreach|for|get|goto|if|implicit|interface|internal|in|is|lock|namespace|new|operator|out|override|params|partial|private|protected|public|readonly|ref|return|sealed|set|sizeof|stackalloc|static|struct|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield|bool|byte|char|decimal|double|fixed|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void)$", RegexOptions.Compiled);
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
119var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled));
SourceGeneration\AdditionalSourcesCollection.cs (1)
27private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CodeStyle (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (1)
CommandLineTests.cs (1)
7537Regex.Replace(output, "^.*a.cs", "a.cs", RegexOptions.Multiline).Trim());
Microsoft.CodeAnalysis.CSharp.EditorFeatures2.UnitTests (788)
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests.cs (6)
40private void Test(string stringText, string expected, RegexOptions options, 67string stringText, RegexOptions options, 110string stringText, RegexOptions options, bool conversionFailureOk) 125string stringText, RegexOptions options, 372(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((""", RegexOptions.None, conversionFailureOk: false); 384var (token, _, chars) = JustParseTree($@"@""{text}""", RegexOptions.None, conversionFailureOk: false);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests_BasicTests.cs (512)
31""", RegexOptions.None); 53""", RegexOptions.IgnorePatternWhitespace); 75""", RegexOptions.IgnorePatternWhitespace); 97""", RegexOptions.None); 119""", RegexOptions.None); 144""", RegexOptions.None); 169""", RegexOptions.None); 192""", RegexOptions.None); 215""", RegexOptions.IgnorePatternWhitespace); 244""", RegexOptions.None); 268""", RegexOptions.IgnorePatternWhitespace); 306""", RegexOptions.None); 341""", RegexOptions.None); 376""", RegexOptions.None); 412""", RegexOptions.None); 448""", RegexOptions.None); 483""", RegexOptions.None); 516""", RegexOptions.None); 549""", RegexOptions.IgnorePatternWhitespace); 585""", RegexOptions.None); 622""", RegexOptions.IgnorePatternWhitespace); 647""", RegexOptions.None); 672""", RegexOptions.None); 697""", RegexOptions.None); 722""", RegexOptions.None); 750""", RegexOptions.None); 779""", RegexOptions.None); 811""", RegexOptions.None); 842""", RegexOptions.IgnorePatternWhitespace); 887""", RegexOptions.IgnorePatternWhitespace); 921""", RegexOptions.IgnorePatternWhitespace); 959""", RegexOptions.IgnorePatternWhitespace); 1011""", RegexOptions.IgnorePatternWhitespace); 1039""", RegexOptions.IgnorePatternWhitespace); 1070""", RegexOptions.IgnorePatternWhitespace); 1101""", RegexOptions.IgnorePatternWhitespace); 1136""", RegexOptions.IgnorePatternWhitespace); 1171""", RegexOptions.IgnorePatternWhitespace); 1196""", RegexOptions.None); 1218""", RegexOptions.None); 1240""", RegexOptions.None); 1265""", RegexOptions.None); 1293""", RegexOptions.None); 1318""", RegexOptions.None); 1346""", RegexOptions.None); 1371""", RegexOptions.None); 1399""", RegexOptions.None); 1424""", RegexOptions.None); 1453""", RegexOptions.None); 1481""", RegexOptions.None); 1513""", RegexOptions.None); 1535""", RegexOptions.None); 1561""", RegexOptions.None); 1587""", RegexOptions.None); 1617""", RegexOptions.None); 1639""", RegexOptions.IgnorePatternWhitespace); 1664""", RegexOptions.IgnorePatternWhitespace); 1690""", RegexOptions.IgnorePatternWhitespace); 1719""", RegexOptions.IgnorePatternWhitespace); 1745""", RegexOptions.None); 1774""", RegexOptions.None); 1801""", RegexOptions.None); 1829""", RegexOptions.None); 1858""", RegexOptions.None); 1885""", RegexOptions.None, runSubTreeTests: false, allowOutOfMemory: true); 1915""", RegexOptions.None, runSubTreeTests: false); 1943""", RegexOptions.None, runSubTreeTests: false, allowOutOfMemory: true); 1974""", RegexOptions.None, runSubTreeTests: false); 2003""", RegexOptions.None, runSubTreeTests: false); 2035""", RegexOptions.None, runSubTreeTests: false); 2067""", RegexOptions.None); 2097""", RegexOptions.None); 2128""", RegexOptions.None); 2160""", RegexOptions.None); 2182""", RegexOptions.None); 2204""", RegexOptions.None); 2226""", RegexOptions.None); 2248""", RegexOptions.None); 2276""", RegexOptions.IgnorePatternWhitespace); 2304""", RegexOptions.IgnorePatternWhitespace); 2332""", RegexOptions.IgnorePatternWhitespace); 2360""", RegexOptions.IgnorePatternWhitespace); 2388""", RegexOptions.IgnorePatternWhitespace); 2416""", RegexOptions.IgnorePatternWhitespace); 2438""", RegexOptions.None); 2460""", RegexOptions.None); 2488""", RegexOptions.None); 2516""", RegexOptions.None); 2547""", RegexOptions.IgnorePatternWhitespace); 2578""", RegexOptions.None); 2603""", RegexOptions.None); 2635""", RegexOptions.None); 2666""", RegexOptions.None); 2691""", RegexOptions.None); 2723""", RegexOptions.None); 2754""", RegexOptions.None); 2779""", RegexOptions.None); 2810""", RegexOptions.None); 2844""", RegexOptions.None); 2872""", RegexOptions.None); 2907""", RegexOptions.None); 2941""", RegexOptions.None); 2963""", RegexOptions.None); 2992""", RegexOptions.None); 3020""", RegexOptions.None); 3046""", RegexOptions.None); 3072""", RegexOptions.None); 3095""", RegexOptions.None); 3170""", RegexOptions.None); 3197""", RegexOptions.None); 3227""", RegexOptions.None); 3251""", RegexOptions.None); 3275""", RegexOptions.None); 3305""", RegexOptions.None); 3342""", RegexOptions.None); 3372""", RegexOptions.None); 3402""", RegexOptions.None); 3426""", RegexOptions.None); 3450""", RegexOptions.None); 3474""", RegexOptions.None); 3504""", RegexOptions.None); 3534""", RegexOptions.None); 3558""", RegexOptions.None); 3582""", RegexOptions.None); 3606""", RegexOptions.None); 3630""", RegexOptions.None); 3654""", RegexOptions.None); 3678""", RegexOptions.None); 3704""", RegexOptions.None); 3731""", RegexOptions.None); 3761""", RegexOptions.None); 3788""", RegexOptions.None); 3818""", RegexOptions.None); 3842""", RegexOptions.None); 3869""", RegexOptions.None); 3896""", RegexOptions.None); 3920""", RegexOptions.None); 3944""", RegexOptions.None); 3968""", RegexOptions.None); 3995""", RegexOptions.None); 4025""", RegexOptions.None); 4054""", RegexOptions.None); 4081""", RegexOptions.None); 4108""", RegexOptions.None); 4135""", RegexOptions.None); 4162""", RegexOptions.None); 4186""", RegexOptions.None); 4213""", RegexOptions.None); 4243""", RegexOptions.None); 4273""", RegexOptions.None); 4303""", RegexOptions.None); 4326""", RegexOptions.None); 4352""", RegexOptions.None); 4375""", RegexOptions.None); 4401""", RegexOptions.None); 4424""", RegexOptions.None); 4450""", RegexOptions.None); 4476""", RegexOptions.None); 4502""", RegexOptions.None); 4528""", RegexOptions.None); 4554""", RegexOptions.None); 4580""", RegexOptions.None); 4603""", RegexOptions.ECMAScript); 4629""", RegexOptions.ECMAScript); 4652""", RegexOptions.ECMAScript); 4675""", RegexOptions.ECMAScript); 4701""", RegexOptions.ECMAScript); 4727""", RegexOptions.None); 4756""", RegexOptions.None); 4785""", RegexOptions.None); 4814""", RegexOptions.None); 4843""", RegexOptions.None); 4872""", RegexOptions.None); 4898""", RegexOptions.None); 4927""", RegexOptions.None); 4956""", RegexOptions.None); 4988""", RegexOptions.None); 5028""", RegexOptions.None); 5054""", RegexOptions.ECMAScript); 5083""", RegexOptions.ECMAScript); 5112""", RegexOptions.ECMAScript); 5138""", RegexOptions.ECMAScript); 5164""", RegexOptions.ECMAScript); 5190""", RegexOptions.ECMAScript); 5216""", RegexOptions.ECMAScript); 5245""", RegexOptions.ECMAScript); 5274""", RegexOptions.None); 5303""", RegexOptions.None); 5332""", RegexOptions.None); 5361""", RegexOptions.None); 5387""", RegexOptions.None); 5416""", RegexOptions.None); 5445""", RegexOptions.None); 5477""", RegexOptions.None); 5517""", RegexOptions.None); 5546""", RegexOptions.None); 5575""", RegexOptions.None); 5601""", RegexOptions.None); 5624""", RegexOptions.None); 5647""", RegexOptions.None); 5673""", RegexOptions.None); 5699""", RegexOptions.None); 5725""", RegexOptions.None); 5750""", RegexOptions.None); 5778""", RegexOptions.None); 5806""", RegexOptions.None); 5837""", RegexOptions.None); 5876""", RegexOptions.None); 5902""", RegexOptions.ECMAScript); 5925""", RegexOptions.ECMAScript); 5948""", RegexOptions.ECMAScript); 5974""", RegexOptions.ECMAScript); 6000""", RegexOptions.ECMAScript); 6026""", RegexOptions.ECMAScript); 6051""", RegexOptions.ECMAScript); 6079""", RegexOptions.ECMAScript); 6102""", RegexOptions.None); 6128""", RegexOptions.None); 6154""", RegexOptions.None); 6180""", RegexOptions.None); 6205""", RegexOptions.None); 6233""", RegexOptions.None); 6261""", RegexOptions.None); 6292""", RegexOptions.None); 6331""", RegexOptions.None); 6357""", RegexOptions.None); 6383""", RegexOptions.None); 6409""", RegexOptions.None); 6438""", RegexOptions.None); 6479""", RegexOptions.IgnorePatternWhitespace); 6511""", RegexOptions.IgnorePatternWhitespace); 6540""", RegexOptions.None); 6566""", RegexOptions.None); 6595""", RegexOptions.None); 6624""", RegexOptions.None); 6653""", RegexOptions.None); 6682""", RegexOptions.None); 6711""", RegexOptions.None); 6737""", RegexOptions.None); 6763""", RegexOptions.None); 6793""", RegexOptions.None); 6822""", RegexOptions.None); 6855""", RegexOptions.IgnorePatternWhitespace); 6881""", RegexOptions.None); 6911""", RegexOptions.None); 6940""", RegexOptions.None); 6973""", RegexOptions.IgnorePatternWhitespace); 6999""", RegexOptions.None); 7029""", RegexOptions.None); 7058""", RegexOptions.None); 7091""", RegexOptions.IgnorePatternWhitespace); 7117""", RegexOptions.None); 7147""", RegexOptions.None); 7176""", RegexOptions.None); 7209""", RegexOptions.IgnorePatternWhitespace); 7236""", RegexOptions.None); 7267""", RegexOptions.None); 7297""", RegexOptions.None); 7331""", RegexOptions.IgnorePatternWhitespace); 7358""", RegexOptions.None); 7389""", RegexOptions.None); 7419""", RegexOptions.None); 7453""", RegexOptions.IgnorePatternWhitespace); 7485""", RegexOptions.IgnorePatternWhitespace); 7517""", RegexOptions.IgnorePatternWhitespace); 7551""", RegexOptions.IgnorePatternWhitespace); 7584""", RegexOptions.IgnorePatternWhitespace); 7621""", RegexOptions.IgnorePatternWhitespace); 7655""", RegexOptions.IgnorePatternWhitespace); 7692""", RegexOptions.None); 7732""", RegexOptions.IgnorePatternWhitespace); 7767""", RegexOptions.None); 7805""", RegexOptions.IgnorePatternWhitespace); 7840""", RegexOptions.None); 7884""", RegexOptions.IgnorePatternWhitespace); 7918""", RegexOptions.IgnorePatternWhitespace); 7953""", RegexOptions.IgnorePatternWhitespace); 7986""", RegexOptions.IgnorePatternWhitespace); 8019""", RegexOptions.IgnorePatternWhitespace); 8048""", RegexOptions.None); 8081""", RegexOptions.None); 8113""", RegexOptions.IgnorePatternWhitespace); 8147""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8181""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8214""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8247""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8277""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8317""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8363""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8403""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8433""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8469""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8505""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8540""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8575""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8607""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8649""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8697""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8739""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8771""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8804""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8840""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8876""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8917""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8958""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 8998""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9038""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9101""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9179""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9262""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9345""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9433""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9511""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9596""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9679""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9762""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9852""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9940""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 9985""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10028""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10060""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10090""", RegexOptions.IgnorePatternWhitespace); 10120""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10152""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10191""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10230""", RegexOptions.IgnorePatternWhitespace, allowIndexOutOfRange: true); 10263""", RegexOptions.IgnorePatternWhitespace); 10295""", RegexOptions.IgnorePatternWhitespace); 10326""", RegexOptions.IgnorePatternWhitespace); 10354""", RegexOptions.IgnorePatternWhitespace); 10386""", RegexOptions.IgnorePatternWhitespace); 10422""", RegexOptions.IgnorePatternWhitespace); 10462""", RegexOptions.IgnorePatternWhitespace); 10509""", RegexOptions.IgnorePatternWhitespace); 10560""", RegexOptions.IgnorePatternWhitespace); 10594""", RegexOptions.IgnorePatternWhitespace); 10625""", RegexOptions.IgnorePatternWhitespace); 10653""", RegexOptions.IgnorePatternWhitespace); 10713""", RegexOptions.IgnorePatternWhitespace); 10782""", RegexOptions.IgnorePatternWhitespace); 10816""", RegexOptions.IgnorePatternWhitespace); 10855""", RegexOptions.IgnorePatternWhitespace); 10903""", RegexOptions.IgnorePatternWhitespace); 10951""", RegexOptions.IgnorePatternWhitespace); 10997""", RegexOptions.None); 11053""", RegexOptions.None); 11092""", RegexOptions.IgnorePatternWhitespace); 11129""", RegexOptions.IgnorePatternWhitespace); 11173""", RegexOptions.IgnorePatternWhitespace); 11217""", RegexOptions.IgnorePatternWhitespace); 11261""", RegexOptions.IgnorePatternWhitespace); 11300""", RegexOptions.IgnorePatternWhitespace); 11339""", RegexOptions.IgnorePatternWhitespace); 11377""", RegexOptions.IgnorePatternWhitespace); 11415""", RegexOptions.IgnorePatternWhitespace); 11452""", RegexOptions.IgnorePatternWhitespace); 11485""", RegexOptions.IgnorePatternWhitespace); 11518""", RegexOptions.IgnorePatternWhitespace); 11544""", RegexOptions.None); 11573""", RegexOptions.None); 11602""", RegexOptions.None); 11634""", RegexOptions.None); 11666""", RegexOptions.None); 11689""", RegexOptions.ECMAScript); 11715""", RegexOptions.ECMAScript); 11744""", RegexOptions.ECMAScript); 11776""", RegexOptions.ECMAScript); 11808""", RegexOptions.ECMAScript); 11894""", RegexOptions.ECMAScript); 11921""", RegexOptions.None); 11952""", RegexOptions.None); 11983""", RegexOptions.None); 12014""", RegexOptions.None); 12042""", RegexOptions.None); 12073""", RegexOptions.None); 12110""", RegexOptions.None); 12148""", RegexOptions.None); 12176""", RegexOptions.None); 12207""", RegexOptions.None); 12241""", RegexOptions.None); 12278""", RegexOptions.None); 12321""", RegexOptions.None); 12370""", RegexOptions.None); 12419""", RegexOptions.None); 12450""", RegexOptions.None); 12493""", RegexOptions.None); 12528""", RegexOptions.None); 12569""", RegexOptions.None); 12610""", RegexOptions.None); 12648""", RegexOptions.None); 12692""", RegexOptions.None); 12735""", RegexOptions.None); 12778""", RegexOptions.None); 12821""", RegexOptions.None); 12864""", RegexOptions.None); 12907""", RegexOptions.None); 12950""", RegexOptions.None); 12979""", RegexOptions.None); 13019""", RegexOptions.None); 13059""", RegexOptions.None); 13090""", RegexOptions.None); 13121""", RegexOptions.None); 13161""", RegexOptions.None); 13198""", RegexOptions.None); 13241""", RegexOptions.None); 13288""", RegexOptions.None); 13331""", RegexOptions.None); 13372""", RegexOptions.None); 13412""", RegexOptions.None); 13452""", RegexOptions.None); 13484""", RegexOptions.None); 13519""", RegexOptions.None); 13554""", RegexOptions.None); 13582""", RegexOptions.None); 13630""", RegexOptions.None); 13678""", RegexOptions.None); 13720""", RegexOptions.None); 13762""", RegexOptions.None); 13799""", RegexOptions.None); 13833""", RegexOptions.None); 13871""", RegexOptions.None, allowDiagnosticsMismatch: true); 13903""", RegexOptions.None); 13939""", RegexOptions.None); 13978""", RegexOptions.None); 14014""", RegexOptions.None); 14053""", RegexOptions.None); 14087""", RegexOptions.None); 14127""", RegexOptions.None); 14164""", RegexOptions.None); 14204""", RegexOptions.None); 14242""", RegexOptions.None); 14280""", RegexOptions.None); 14322""", RegexOptions.None); 14364""", RegexOptions.None); 14402""", RegexOptions.None); 14440""", RegexOptions.None); 14481""", RegexOptions.None); 14517""", RegexOptions.None); 14556""", RegexOptions.None); 14590""", RegexOptions.None); 14627""", RegexOptions.None); 14661""", RegexOptions.None); 14695""", RegexOptions.IgnoreCase); 14732""", RegexOptions.IgnoreCase); 14766""", RegexOptions.IgnoreCase); 14802""", RegexOptions.None); 14838""", RegexOptions.None); 14877""", RegexOptions.None); 14916""", RegexOptions.None); 14952""", RegexOptions.None); 14991""", RegexOptions.None); 15028""", RegexOptions.None); 15065""", RegexOptions.None); 15102""", RegexOptions.None); 15142""", RegexOptions.None); 15182""", RegexOptions.None); 15219""", RegexOptions.None); 15257""", RegexOptions.None); 15295""", RegexOptions.None); 15333""", RegexOptions.None); 15371""", RegexOptions.None); 15412""", RegexOptions.None); 15453""", RegexOptions.None); 15494""", RegexOptions.None); 15535""", RegexOptions.None); 15567""", RegexOptions.None); 15599""", RegexOptions.None); 15637""", RegexOptions.None, allowDiagnosticsMismatch: true); 15678""", RegexOptions.None, allowDiagnosticsMismatch: true); 15723""", RegexOptions.None, allowDiagnosticsMismatch: true); 15764""", RegexOptions.None, allowDiagnosticsMismatch: true); 15809""", RegexOptions.None, allowDiagnosticsMismatch: true); 15851""", RegexOptions.None, allowDiagnosticsMismatch: true); 15897""", RegexOptions.None, allowDiagnosticsMismatch: true); 15939""", RegexOptions.None, allowDiagnosticsMismatch: true); 15983""", RegexOptions.None, allowDiagnosticsMismatch: true); 16012""", RegexOptions.None); 16044""", RegexOptions.None); 16079""", RegexOptions.None); 16110""", RegexOptions.ExplicitCapture); 16141""", RegexOptions.ExplicitCapture); 16177""", RegexOptions.ExplicitCapture); 16222""", RegexOptions.None); 16269""", RegexOptions.None); 16316""", RegexOptions.None); 16363""", RegexOptions.ExplicitCapture); 16410""", RegexOptions.ExplicitCapture); 16457""", RegexOptions.ExplicitCapture); 16502""", RegexOptions.None); 16547""", RegexOptions.None); 16592""", RegexOptions.None); 16639""", RegexOptions.ExplicitCapture); 16686""", RegexOptions.ExplicitCapture); 16731""", RegexOptions.ExplicitCapture); 16779""", RegexOptions.None); 16829""", RegexOptions.ExplicitCapture); 16877""", RegexOptions.None); 16927""", RegexOptions.ExplicitCapture); 16974""", RegexOptions.None); 17023""", RegexOptions.ExplicitCapture); 17070""", RegexOptions.None); 17119""", RegexOptions.ExplicitCapture); 17170""", RegexOptions.None); 17221""", RegexOptions.ExplicitCapture); 17274""", RegexOptions.None); 17327""", RegexOptions.ExplicitCapture); 17602""", RegexOptions.None); 17697""", RegexOptions.None); 17931""", RegexOptions.None); 18336""", RegexOptions.None); 19181""", RegexOptions.None); 19242""", RegexOptions.None);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests_DotnetNegativeTests.cs (140)
67""", RegexOptions.None); 96""", RegexOptions.None); 125""", RegexOptions.None); 151""", RegexOptions.None); 177""", RegexOptions.None); 208""", RegexOptions.None); 239""", RegexOptions.None); 270""", RegexOptions.None); 299""", RegexOptions.None); 329""", RegexOptions.None); 359""", RegexOptions.None); 388""", RegexOptions.None); 417""", RegexOptions.None); 452""", RegexOptions.None); 480""", RegexOptions.None); 509""", RegexOptions.None); 542""", RegexOptions.None); 574""", RegexOptions.None); 602""", RegexOptions.None); 633""", RegexOptions.None); 665""", RegexOptions.None); 702""", RegexOptions.None); 731""", RegexOptions.None); 760""", RegexOptions.None); 789""", RegexOptions.None); 818""", RegexOptions.None); 847""", RegexOptions.None); 876""", RegexOptions.None); 904""", RegexOptions.None); 937""", RegexOptions.None); 969""", RegexOptions.None); 1002""", RegexOptions.None); 1031""", RegexOptions.None); 1060""", RegexOptions.None); 1093""", RegexOptions.None); 1130""", RegexOptions.None); 1173""", RegexOptions.None); 1216""", RegexOptions.None); 1262""", RegexOptions.None); 1312""", RegexOptions.None); 1366""", RegexOptions.None); 1397""", RegexOptions.None, allowNullReference: true); 1432""", RegexOptions.None); 1463""", RegexOptions.None, allowNullReference: true); 1494""", RegexOptions.None, allowNullReference: true); 1525""", RegexOptions.None, allowNullReference: true); 1556""", RegexOptions.None, allowNullReference: true); 1587""", RegexOptions.None, allowNullReference: true); 1618""", RegexOptions.None, allowNullReference: true); 1649""", RegexOptions.None, allowNullReference: true); 1680""", RegexOptions.None, allowNullReference: true); 1711""", RegexOptions.None); 1746""", RegexOptions.None); 1785""", RegexOptions.None); 1822""", RegexOptions.None); 1863""", RegexOptions.None); 1901""", RegexOptions.None); 1939""", RegexOptions.None); 1978""", RegexOptions.None); 2017""", RegexOptions.None); 2050""", RegexOptions.None); 2079""", RegexOptions.None); 2114""", RegexOptions.None); 2153""", RegexOptions.None); 2206""", RegexOptions.None); 2249""", RegexOptions.None); 2290""", RegexOptions.None); 2332""", RegexOptions.None); 2367""", RegexOptions.None); 2398""", RegexOptions.None, allowNullReference: true); 2429""", RegexOptions.None); 2456""", RegexOptions.None); 2505""", RegexOptions.IgnorePatternWhitespace); 2553""", RegexOptions.None); 2601""", RegexOptions.None); 2649""", RegexOptions.None); 2698""", RegexOptions.None); 2768""", RegexOptions.None, allowIndexOutOfRange: true); 2829""", RegexOptions.None, allowIndexOutOfRange: true); 2890""", RegexOptions.None, allowIndexOutOfRange: true); 2951""", RegexOptions.None, allowIndexOutOfRange: true); 2991""", RegexOptions.None, allowIndexOutOfRange: true); 3029""", RegexOptions.None); 3082""", RegexOptions.None); 3135""", RegexOptions.None); 3188""", RegexOptions.None); 3237""", RegexOptions.None); 3276""", RegexOptions.None); 3314""", RegexOptions.None); 3365""", RegexOptions.None); 3419""", RegexOptions.None); 3470""", RegexOptions.None); 3521""", RegexOptions.None); 3575""", RegexOptions.None); 3661""", RegexOptions.None); 3716""", RegexOptions.None); 3820""", RegexOptions.None); 3852""", RegexOptions.None); 3894""", RegexOptions.None); 3936""", RegexOptions.None); 3973""", RegexOptions.None); 4010""", RegexOptions.None); 4072""", RegexOptions.None); 4104""", RegexOptions.None); 4170""", RegexOptions.None); 4236""", RegexOptions.None); 4305""", RegexOptions.None); 4353""", RegexOptions.None); 4396""", RegexOptions.None); 4439""", RegexOptions.None); 4482""", RegexOptions.None); 4528""", RegexOptions.None); 4574""", RegexOptions.None); 4623""", RegexOptions.None); 4669""", RegexOptions.None); 4715""", RegexOptions.None); 4761""", RegexOptions.None); 4788""", RegexOptions.None); 4815""", RegexOptions.None); 4842""", RegexOptions.None); 4869""", RegexOptions.None); 4915""", RegexOptions.None); 4942""", RegexOptions.None); 4992""", RegexOptions.None); 5038""", RegexOptions.None); 5107""", RegexOptions.ECMAScript); 5173""", RegexOptions.None); 5239""", RegexOptions.ECMAScript); 5282""", RegexOptions.None); 5335""", RegexOptions.None); 5388""", RegexOptions.None); 5433""", RegexOptions.None); 5490""", RegexOptions.None); 5550""", RegexOptions.None); 5611""", RegexOptions.None); 5671""", RegexOptions.None); 5733""", RegexOptions.None); 5787""", RegexOptions.None, runSubTreeTests: false); 5834""", RegexOptions.None); 5871""", RegexOptions.None);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests_RealWorld.cs (2)
24RegexOptions.None, conversionFailureOk: false); 32var (_, tree, _) = JustParseTree($@"@""{pattern}""", (RegexOptions)options, conversionFailureOk: false);
EmbeddedLanguages\RegularExpressions\CSharpRegexParserTests_ReferenceTests.cs (128)
41""", RegexOptions.None); 113""", RegexOptions.None); 192""", RegexOptions.None); 240""", RegexOptions.None); 273""", RegexOptions.None); 310""", RegexOptions.None); 367""", RegexOptions.None); 439""", RegexOptions.None); 519""", RegexOptions.None); 683""", RegexOptions.None); 738""", RegexOptions.None); 790""", RegexOptions.None); 844""", RegexOptions.None); 914""", RegexOptions.None); 984""", RegexOptions.None); 1047""", RegexOptions.None); 1093""", RegexOptions.None); 1236""", RegexOptions.None, allowIndexOutOfRange: true); 1298""", RegexOptions.None, allowIndexOutOfRange: true); 1342""", RegexOptions.None); 1374""", RegexOptions.None); 1407""", RegexOptions.None); 1497""", RegexOptions.None); 1545""", RegexOptions.None); 1594""", RegexOptions.None); 1701""", RegexOptions.None, allowIndexOutOfRange: true); 1746""", RegexOptions.None); 1798""", RegexOptions.None); 1832""", RegexOptions.None); 1888""", RegexOptions.None); 1948""", RegexOptions.None); 1987""", RegexOptions.None, allowIndexOutOfRange: true); 2019""", RegexOptions.None); 2068""", RegexOptions.None); 2114""", RegexOptions.None); 2161""", RegexOptions.None); 2196""", RegexOptions.None); 2249""", RegexOptions.None); 2351""", RegexOptions.None); 2409""", RegexOptions.None); 2437""", RegexOptions.None); 2466""", RegexOptions.None); 2513""", RegexOptions.None); 2549""", RegexOptions.None); 2586""", RegexOptions.None); 2635""", RegexOptions.None); 2664""", RegexOptions.None); 2690""", RegexOptions.None); 2755""", RegexOptions.None); 2791""", RegexOptions.None); 2827""", RegexOptions.None); 2856""", RegexOptions.None); 2890""", RegexOptions.None); 2968""", RegexOptions.None); 3024""", RegexOptions.None); 3050""", RegexOptions.None); 3115""", RegexOptions.None); 3207""", RegexOptions.None); 3241""", RegexOptions.None); 3267""", RegexOptions.None); 3311""", RegexOptions.None); 3360""", RegexOptions.None); 3418""", RegexOptions.None); 3456""", RegexOptions.None); 3521""", RegexOptions.None); 3569""", RegexOptions.None); 3606""", RegexOptions.None); 3639""", RegexOptions.None); 3662""", RegexOptions.None); 3717""", RegexOptions.None); 3769""", RegexOptions.None); 3823""", RegexOptions.None); 3867""", RegexOptions.None); 3946""", RegexOptions.None); 4029""", RegexOptions.None); 4078""", RegexOptions.None); 4126""", RegexOptions.None); 4178""", RegexOptions.None); 4215""", RegexOptions.None); 4264""", RegexOptions.None); 4321""", RegexOptions.None); 4385""", RegexOptions.Multiline); 4455""", RegexOptions.Multiline); 4489""", RegexOptions.None); 4595""", RegexOptions.None); 4682""", RegexOptions.None); 4775""", RegexOptions.None); 4865""", RegexOptions.None); 4953""", RegexOptions.IgnorePatternWhitespace); 5073""", RegexOptions.None); 5110""", RegexOptions.RightToLeft); 5179""", RegexOptions.RightToLeft); 5226""", RegexOptions.ECMAScript); 5285""", RegexOptions.ECMAScript); 5350""", RegexOptions.None); 5429""", RegexOptions.None); 5500""", RegexOptions.None); 5588""", RegexOptions.None); 5699""", RegexOptions.None); 5792""", RegexOptions.None); 5843""", RegexOptions.None); 5895""", RegexOptions.None); 5949""", RegexOptions.None); 5991""", RegexOptions.None); 6037""", RegexOptions.None); 6073""", RegexOptions.None); 6120""", RegexOptions.None); 6164""", RegexOptions.None); 6204""", RegexOptions.None); 6254""", RegexOptions.None); 6291""", RegexOptions.None); 6374""", RegexOptions.None); 6412""", RegexOptions.None); 6484""", RegexOptions.None); 6565""", RegexOptions.None); 6624""", RegexOptions.None); 6687""", RegexOptions.None); 6722""", RegexOptions.None); 6781""", RegexOptions.None); 6838""", RegexOptions.None); 6872""", RegexOptions.None); 6914""", RegexOptions.None); 6955""", RegexOptions.None); 7008""", RegexOptions.None); 7092""", RegexOptions.None); 7134""", RegexOptions.None); 7210""", RegexOptions.None); 7309""", RegexOptions.None);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.EditorFeatures (2)
LanguageServer\RazorInProcLanguageClient.cs (2)
84var regex = new Regex(regexExpression, RegexOptions.Compiled | RegexOptions.Singleline, TimeSpan.FromSeconds(1));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (11)
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexPatternDetectorTests.cs (11)
14private static void Match(string value, RegexOptions? expectedOptions = null) 23static void MatchWorker(string value, RegexOptions? expectedOptions) 29Assert.True(EmbeddedLanguageCommentOptions<RegexOptions>.TryGetOptions(captures!, out var actualOptions)); 47EmbeddedLanguageCommentOptions<RegexOptions>.TryGetOptions(stringOptions, out _)); 121=> Match("lang=regex,ecmascript", RegexOptions.ECMAScript); 125=> Match("lang=regex , ecmascript", RegexOptions.ECMAScript); 129=> Match("lang=regex,ecmascript. Explanation", RegexOptions.ECMAScript); 133=> Match("lang=regex,ecmascript,ignorecase. Explanation", RegexOptions.ECMAScript | RegexOptions.IgnoreCase); 137=> Match("Language=Regexp,ECMAScript,IgnoreCase. Explanation", RegexOptions.ECMAScript | RegexOptions.IgnoreCase);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (1)
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.Features (56)
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (3)
24private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled); 116var result = Regex.Replace(numericText, $"(.{{{interval}}})", "_$1", RegexOptions.RightToLeft);
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (3)
29RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase | RegexOptions.Compiled);
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (2)
214RegexOptions.Compiled | RegexOptions.IgnorePatternWhitespace);
EmbeddedLanguages\RegularExpressions\LanguageServices\RegexLanguageDetector.cs (8)
27: AbstractLanguageDetector<RegexOptions, RegexTree, RegexLanguageDetector, RegexLanguageDetector.RegexInfo>( 77out RegexOptions options) 148out RegexOptions options) 162protected override RegexTree? TryParse(VirtualCharSequence chars, RegexOptions options) 169out RegexOptions options) 184SemanticModel semanticModel, ITypeSymbol exprType, SyntaxNode expr, CancellationToken cancellationToken, out RegexOptions options) 186if (exprType.Name == nameof(RegexOptions)) 191options = (RegexOptions)intValue;
EmbeddedLanguages\RegularExpressions\RegexHelpers.cs (2)
20public static bool HasOption(RegexOptions options, RegexOptions val)
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (8)
57public RegexToken ScanNextToken(bool allowTrivia, RegexOptions options) 99private ImmutableArray<RegexTrivia> ScanLeadingTrivia(bool allowTrivia, RegexOptions options) 130public RegexTrivia? ScanComment(RegexOptions options) 137if (HasOption(options, RegexOptions.IgnorePatternWhitespace)) 198private RegexTrivia? ScanWhitespace(RegexOptions options) 200if (HasOption(options, RegexOptions.IgnorePatternWhitespace)) 416public RegexToken ScanOctalCharacters(RegexOptions options) 443if (HasOption(options, RegexOptions.ECMAScript) && currentVal >= 0x20)
EmbeddedLanguages\RegularExpressions\RegexParser.CaptureInfoAnalyzer.cs (7)
51VirtualCharSequence text, RegexCompilationUnit root, RegexOptions options) 58RegexCompilationUnit root, RegexOptions options) 67private void CollectCaptures(RegexNode node, RegexOptions options) 81private void CollectCapturesWorker(RegexNode node, RegexOptions options) 120private void RecurseIntoChildren(RegexNode node, RegexOptions options) 149private void RecordSimpleGroupingCapture(RegexSimpleGroupingNode node, RegexOptions options) 151if (HasOption(options, RegexOptions.ExplicitCapture))
EmbeddedLanguages\RegularExpressions\RegexParser.cs (23)
86private RegexOptions _options; 91VirtualCharSequence text, RegexOptions options, 113/// For example, if <see cref="RegexOptions.IgnorePatternWhitespace"/> is currently 128public static RegexTree? TryParse(VirtualCharSequence text, RegexOptions options) 686private RegexExpressionNode ParseGroupingEmbeddedExpression(RegexOptions embeddedOptions) 689var currentOptions = _options; 933var currentOptions = _options; 952ParseGroupingEmbeddedExpression(_options | RegexOptions.RightToLeft), ParseGroupingCloseParen()); 957ParseGroupingEmbeddedExpression(_options | RegexOptions.RightToLeft), ParseGroupingCloseParen()); 1130ParseGroupingEmbeddedExpression(_options & ~RegexOptions.RightToLeft), ParseGroupingCloseParen()); 1135ParseGroupingEmbeddedExpression(_options & ~RegexOptions.RightToLeft), ParseGroupingCloseParen()); 1176private static RegexOptions GetNewOptionsFromToken(RegexOptions currentOptions, RegexToken optionsToken) 1178var copy = currentOptions; 1187var newOption = OptionFromCode(ch); 1204private static RegexOptions OptionFromCode(VirtualChar ch) 1208case 'i': case 'I': return RegexOptions.IgnoreCase; 1209case 'm': case 'M': return RegexOptions.Multiline; 1210case 'n': case 'N': return RegexOptions.ExplicitCapture; 1211case 's': case 'S': return RegexOptions.Singleline; 1212case 'x': case 'X': return RegexOptions.IgnorePatternWhitespace; 1682return HasOption(_options, RegexOptions.ECMAScript) 1878if (!HasOption(_options, RegexOptions.ECMAScript) && RegexCharClass.IsBoundaryWordChar(ch))
Microsoft.CodeAnalysis.Features.Test.Utilities (5)
EditAndContinue\SourceMarkers.cs (5)
20"[<] (?<IsEnd>/?) (?<Name>(AS|ER|N|S|TS))[:] (?<Id>[.0-9,]+) (?<IsStartAndEnd>/?) [>]", RegexOptions.IgnorePatternWhitespace); 26RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); 32RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);
Microsoft.CodeAnalysis.LanguageServer.Protocol (3)
Extensions\ProtocolConversions.cs (1)
42private static readonly Regex s_markdownEscapeRegex = new(@"([\\`\*_\{\}\[\]\(\)#+\-\.!])", RegexOptions.Compiled);
Protocol\Internal\Converters\RegexConverter.cs (2)
20return new Regex(reader.GetString(), RegexOptions.Compiled | RegexOptions.ECMAScript, matchTimeout: TimeSpan.FromMilliseconds(1000));
Microsoft.CodeAnalysis.Test.Utilities (8)
CompilationVerifier.cs (2)
201private static readonly Regex s_headerCommentsRegex = new("""^\s*// Header size: [0-9]+\s*$""", RegexOptions.Multiline); 202private static readonly Regex s_codeSizeCommentsRegex = new("""^\s*// Code size(:) [0-9]+\s*""", RegexOptions.Multiline);
MarkedSource\MarkupTestFile.cs (2)
50RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
MarkedSource\SourceWithMarkedNodes.cs (4)
87RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline); 105RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (2)
CommandLineTests.vb (2)
5364output = Regex.Replace(output, "^.*" & fileName, fileName, RegexOptions.Multiline) 6481Dim actual = Regex.Replace(output, "^.*a.vb", "a.vb", RegexOptions.Multiline).Trim()
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (4)
CodeGen\CodeGenAsyncTests.vb (2)
9182Dim TypeNamePattern As New Regex("^VB\$StateMachine_(\d)+_(\w)+$", RegexOptions.Singleline) 9183Dim FieldPattern As New Regex("^((\$Builder)|(\$Stack)|(\$State)|(\$VB\$Me)|(\$A(\d)+)|(\$S(\d)+)|(\$I(\d)+)|(\$VB\$ResumableLocal_\$(\d)+)|(\$U(\d)+))$", RegexOptions.Singleline)
CodeGen\CodeGenVBCore.vb (2)
3152Private Shared ReadOnly s_normalizeRegex As New Regex("^(\s*)", RegexOptions.Multiline) 3213expected = New Regex("^" + indent, RegexOptions.Multiline).Replace(expected, "")
Microsoft.CodeAnalysis.Workspaces (7)
Rename\RenameUtilities.cs (1)
292return new Regex(matchString, RegexOptions.CultureInvariant);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Workspace\Solution\ProjectInfo.cs (1)
432private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (3)
TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.Data.Analysis.Tests (3)
src\Microsoft.Data.Analysis\TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.DotNet.Arcade.Sdk (3)
src\GenerateResxSource.cs (3)
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.SignCheckLibrary (1)
Verification\Exclusions.cs (1)
162return Regex.IsMatch(value, regexPattern, RegexOptions.IgnoreCase);
Microsoft.DotNet.SourceBuild.Tasks (4)
src\UsageReport\UsagePattern.cs (4)
30return new Regex(IdentityRegex, RegexOptions.IgnoreCase | RegexOptions.Compiled); 40RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.DotNet.XUnitAssert.Tests (1)
StringAssertsTests.cs (1)
796 Assert.Matches(new Regex(@"[a-z]+", RegexOptions.IgnoreCase), "HELLO");
Microsoft.Extensions.Http.Diagnostics (1)
Http\DownstreamDependencyMetadataManagerRegex.cs (1)
23public static Regex MakeRouteRegex() => new(RouteRegexString, RegexOptions.Compiled);
Microsoft.Gen.ComplianceReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.ContextualOptions.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Logging.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private static readonly Regex _regexTagNames = new("^[A-Za-z]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
24private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 25private static readonly Regex _regexTagNames = new("^[A-Za-z]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports.Unit.Tests (3)
test\Generators\Shared\RoslynTestUtils.cs (3)
513results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 521results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase)); 528results.Add(Regex.Replace(s.ToString(), "\r\n", "\n", RegexOptions.IgnoreCase));
Microsoft.Maui.Controls.DesignTools (6)
ColorDesignTypeConverter.cs (6)
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 (2)
Utils.cs (2)
13 = new Regex(@"^[a-z]([a-z0-9_]*[a-z0-9])?$", RegexOptions.Singleline | RegexOptions.Compiled);
Microsoft.ML.AutoML (1)
ColumnInference\ColumnTypeInference.cs (1)
219if (Regex.IsMatch(v, candidate, RegexOptions.IgnoreCase))
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 (11)
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1065RegexOptions.Compiled);
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.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 (54)
BaseTestBaseline.cs (54)
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 (8)
Model\SentencePieceTokenizer.cs (1)
90_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Model\TiktokenTokenizer.cs (3)
1178[GeneratedRegex(Cl100kBaseRegexPattern, RegexOptions.None, PreTokenizer.DefaultTimeOutInMilliseconds)] 1181[GeneratedRegex(P50kBaseRegexPattern, RegexOptions.None, PreTokenizer.DefaultTimeOutInMilliseconds)] 1184[GeneratedRegex(O200kBaseRegexPattern, RegexOptions.None, PreTokenizer.DefaultTimeOutInMilliseconds)]
PreTokenizer\PreTokenizer.cs (3)
49[GeneratedRegex(WhiteSpaceOrPunctuationPattern, RegexOptions.None, DefaultTimeOutInMilliseconds)] 78[GeneratedRegex(WordOrNonWordPattern, RegexOptions.None, DefaultTimeOutInMilliseconds)] 108[GeneratedRegex(WhiteSpacePattern, RegexOptions.None, DefaultTimeOutInMilliseconds)]
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
MSBuild (4)
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
DebugUtils.cs (1)
72var match = Regex.Match(input, @"/nodemode:(?<nodemode>[12\s])(\s|$)", RegexOptions.IgnoreCase);
XMake.cs (1)
2258responseFileDirectory, RegexOptions.IgnoreCase);
MSBuildTaskHost (2)
BuildEnvironmentHelper.cs (2)
172Regex.IsMatch(msBuildExe, $@".*\\MSBuild\\{CurrentToolsVersion}\\Bin\\.*MSBuild(?:TaskHost)?\.exe", RegexOptions.IgnoreCase)) 245Regex.IsMatch(msbuildExe, msBuildPathPattern, RegexOptions.IgnoreCase))
Mvc.RoutingWebSite (1)
TestParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromSeconds(10)).ToLowerInvariant();
netstandard (1)
netstandard.cs (1)
2054[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.RegexOptions))]
PresentationBuildTasks (2)
Microsoft\Build\Tasks\Windows\UidManager.cs (2)
1330private static Regex EscapedXmlEntities = new Regex("(<|>|\"|'|&)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
PresentationFramework (6)
MS\Internal\Globalization\BamlResourceContent.cs (2)
90private static Regex UnescapePattern = new Regex("(\\\\.?|&lt;|&gt;|&quot;|&apos;|&amp;)", RegexOptions.CultureInvariant | RegexOptions.Compiled);
System\Windows\Documents\WinRTSpellerInterop.cs (4)
558RegexOptions regexOptions = RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.Compiled;
RoutingSandbox (2)
SlugifyParameterTransformer.cs (1)
13return value == null ? null : Regex.Replace(value.ToString(), "([a-z])([A-Z])", "$1-$2", RegexOptions.None, TimeSpan.FromMilliseconds(100)).ToLowerInvariant();
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
RoutingWebSite (1)
UseRouterStartup.cs (1)
34constraints: new { lastName = new RegexRouteConstraint(new Regex("[a-zA-Z]{3}", RegexOptions.CultureInvariant, RegexMatchTimeout)) });
SemanticSearch.BuildTask (5)
GenerateFilteredReferenceAssembliesTask.cs (5)
55""", RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace); 194RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
System (1)
src\libraries\shims\System\ref\System.cs (1)
910[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Text.RegularExpressions.RegexOptions))]
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
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 (5)
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (3)
54[GeneratedRegex(ConnectionStringPattern, RegexOptions.ExplicitCapture)] 57[GeneratedRegex(ConnectionStringPatternOdbc, RegexOptions.ExplicitCapture)] 75[GeneratedRegex("^\\{([^\\}\u0000]|\\}\\})*\\}$", RegexOptions.ExplicitCapture)]
System\Data\Common\DBCommandBuilder.cs (2)
47_parameterNameParser = new Regex(_dbCommandBuilder.ParameterNamePattern!, RegexOptions.ExplicitCapture | RegexOptions.Singleline);
System.Data.Odbc (3)
src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (3)
54[GeneratedRegex(ConnectionStringPattern, RegexOptions.ExplicitCapture)] 57[GeneratedRegex(ConnectionStringPatternOdbc, RegexOptions.ExplicitCapture)] 75[GeneratedRegex("^\\{([^\\}\u0000]|\\}\\})*\\}$", RegexOptions.ExplicitCapture)]
System.Drawing.Common.Tests (2)
System\Drawing\Imaging\ImageCodecInfoTests.cs (2)
94RegexOptions.IgnoreCase | RegexOptions.Singleline);
System.Net.WebProxy (10)
System\Net\WebProxy.cs (10)
27public WebProxy(Uri? Address, bool BypassOnLocal, [StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] string[]? BypassList) : this(Address, BypassOnLocal, BypassList, null) { } 29public WebProxy(Uri? Address, bool BypassOnLocal, [StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] string[]? BypassList, ICredentials? Credentials) 56public WebProxy(string? Address, bool BypassOnLocal, [StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] string[]? BypassList) 61public WebProxy(string? Address, bool BypassOnLocal, [StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] string[]? BypassList, ICredentials? Credentials) 140regexBypassList[i] = new Regex((string)bypassList[i]!, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
System.Private.Xml (1)
System\Xml\Schema\FacetChecker.cs (1)
1344[GeneratedRegex("^([a-zA-Z]{1,8})(-[a-zA-Z0-9]{1,8})*$", RegexOptions.ExplicitCapture)]
System.Text.Json (1)
System\Text\Json\JsonHelpers.cs (1)
324[GeneratedRegex(IntegerRegexPattern, RegexOptions.None, matchTimeoutMilliseconds: IntegerRegexTimeoutMs)]
System.Text.RegularExpressions (252)
System\Text\RegularExpressions\GeneratedRegexAttribute.cs (7)
16/// When the <see cref="Regex"/> supports case-insensitive matches (either by passing <see cref="RegexOptions.IgnoreCase"/> or using the inline `(?i)` switch in the pattern) the regex 29public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex)] string pattern) : this(pattern, RegexOptions.None) 36public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) : this(pattern, options, Timeout.Infinite) 51public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, string cultureName) : this(pattern, options, Timeout.Infinite, cultureName) 59public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, int matchTimeoutMilliseconds) : this(pattern, options, matchTimeoutMilliseconds, string.Empty /* Empty string means Invariant culture */) 75public GeneratedRegexAttribute([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, int matchTimeoutMilliseconds, string cultureName) 87public RegexOptions Options { get; }
System\Text\RegularExpressions\Regex.Cache.cs (4)
120Key key = new Key(pattern, culture.ToString(), RegexOptions.None, Regex.s_defaultMatchTimeout); 132public static Regex GetOrAdd(string pattern, RegexOptions options, TimeSpan matchTimeout) 281private readonly RegexOptions _options; 284public Key(string pattern, string culture, RegexOptions options, TimeSpan matchTimeout)
System\Text\RegularExpressions\Regex.Count.cs (4)
76public static int Count(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 88public static int Count(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 110public static int Count(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 123public static int Count(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.cs (27)
26protected internal RegexOptions roptions; // the top-level options from the options string 60public Regex([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) : 65public Regex([StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) : 76RegexTree tree = Init(pattern, RegexOptions.None, s_defaultMatchTimeout, ref culture); 88internal Regex(string pattern, RegexOptions options, TimeSpan matchTimeout, CultureInfo? culture) 99if ((options & RegexOptions.NonBacktracking) != 0) 106if (RuntimeFeature.IsDynamicCodeCompiled && (options & RegexOptions.Compiled) != 0) 120private RegexTree Init(string pattern, RegexOptions options, TimeSpan matchTimeout, [NotNull] ref CultureInfo? culture) 147internal static void ValidateOptions(RegexOptions options) 151((options & RegexOptions.ECMAScript) != 0 && (options & ~(RegexOptions.ECMAScript | RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.CultureInvariant)) != 0) || 152((options & RegexOptions.NonBacktracking) != 0 && (options & (RegexOptions.ECMAScript | RegexOptions.RightToLeft)) != 0)) 218private static RegexRunnerFactory? Compile(string pattern, RegexTree regexTree, RegexOptions options, bool hasTimeout) => 247RegexOptions options = regexinfos[i].Options | RegexOptions.Compiled; // ensure compiled is set; it enables more optimization specific to compilation 253RegexTree tree = RegexParser.Parse(pattern, options, (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture); 301public RegexOptions Options => roptions; 306public bool RightToLeft => (roptions & RegexOptions.RightToLeft) != 0; 652/// <summary>True if the <see cref="RegexOptions.Compiled"/> option was set.</summary> 655protected bool UseOptionC() => (roptions & RegexOptions.Compiled) != 0; 657/// <summary>True if the <see cref="RegexOptions.RightToLeft"/> option was set.</summary>
System\Text\RegularExpressions\Regex.EnumerateMatches.cs (2)
43public static ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 63public static ValueMatchEnumerator EnumerateMatches(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.EnumerateSplits.cs (20)
19/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, string)"/> will reverse the order of the resulting splits to be left-to-right, whereas 41/// The behavior of <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions)"/> is similar to the behavior of <see cref="Split(string, string, RegexOptions)"/>, producing the splits 43/// <see cref="Split(string, string, RegexOptions)"/> will include the contents of capture groups in the resulting splits, while <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions)"/> will not. 44/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, string, RegexOptions)"/> will reverse the order of the resulting splits to be left-to-right, whereas 45/// <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions)"/> will yield the splits in the order they're found right-to-left. 60public static ValueSplitEnumerator EnumerateSplits(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 68/// The behavior of <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> is similar to the behavior of <see cref="Split(string, string, RegexOptions, TimeSpan)"/>, producing the splits 70/// <see cref="Split(string, string, RegexOptions, TimeSpan)"/> will include the contents of capture groups in the resulting splits, while <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> will not. 71/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, string, RegexOptions, TimeSpan)"/> will reverse the order of the resulting splits to be left-to-right, whereas 72/// <see cref="EnumerateSplits(ReadOnlySpan{char}, string, RegexOptions, TimeSpan)"/> will yield the splits in the order they're found right-to-left. 88public static ValueSplitEnumerator EnumerateSplits(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 99/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string)"/> will reverse the order of the resulting splits to be left-to-right, whereas 121/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, int)"/> will reverse the order of the resulting splits to be left-to-right, whereas 144/// And if <see cref="RegexOptions.RightToLeft"/> is specified, <see cref="Split(string, int, int)"/> will reverse the order of the resulting splits to be left-to-right, whereas
System\Text\RegularExpressions\Regex.Match.cs (10)
33public static bool IsMatch(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 46/// <exception cref="ArgumentOutOfRangeException"><paramref name="options"/> is not in a valid <see cref="RegexOptions"/> value.</exception> 47public static bool IsMatch(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 50public static bool IsMatch(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 64/// <exception cref="ArgumentOutOfRangeException"><paramref name="options"/> is not in a valid <see cref="RegexOptions"/> value or <paramref name="matchTimeout"/> is negative, 66public static bool IsMatch(ReadOnlySpan<char> input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 128public static Match Match(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 131public static Match Match(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) => 184public static MatchCollection Matches(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 187public static MatchCollection Matches(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Replace.cs (4)
27public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, string replacement, RegexOptions options) => 30public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, string replacement, RegexOptions options, TimeSpan matchTimeout) => 97public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, MatchEvaluator evaluator, RegexOptions options) => 100public static string Replace(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, MatchEvaluator evaluator, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Split.cs (2)
21public static string[] Split(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options) => 24public static string[] Split(string input, [StringSyntax(StringSyntaxAttribute.Regex, nameof(options))] string pattern, RegexOptions options, TimeSpan matchTimeout) =>
System\Text\RegularExpressions\Regex.Timeout.cs (1)
57/// (<see cref="RegexOptions.NonBacktracking"/>), as the purpose of the timeout is to thwart excessive backtracking. Such implementations
System\Text\RegularExpressions\RegexAssemblyCompiler.cs (2)
45internal void GenerateRegexType(string pattern, RegexOptions options, string name, bool isPublic, RegexTree tree, RegexInterpreterCode code, TimeSpan matchTimeout) 101RegexOptions options,
System\Text\RegularExpressions\RegexCaseBehavior.cs (2)
9/// When a regular expression specifies the option <see cref="RegexOptions.IgnoreCase"/> then comparisons between the input and the 27/// specified <see cref="RegexOptions.CultureInvariant"/> or when the CurrentCulture is <see cref="CultureInfo.InvariantCulture"/>.
System\Text\RegularExpressions\RegexCompilationInfo.cs (3)
17public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic) 22public RegexCompilationInfo(string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic, TimeSpan matchTimeout) 66public RegexOptions Options { get; set; }
System\Text\RegularExpressions\RegexCompiler.cs (3)
115protected RegexOptions _options; 137internal static RegexRunnerFactory? Compile(string pattern, RegexTree regexTree, RegexOptions options, bool hasTimeout) => 397bool rtl = (_options & RegexOptions.RightToLeft) != 0;
System\Text\RegularExpressions\RegexFindOptimizations.cs (4)
18public RegexFindOptimizations(RegexNode root, RegexOptions options) 20_rightToLeft = (options & RegexOptions.RightToLeft) != 0; 84bool dfa = (options & RegexOptions.NonBacktracking) != 0; 85bool compiled = (options & RegexOptions.Compiled) != 0 && !dfa; // for now, we never generate code for NonBacktracking, so treat it as non-compiled
System\Text\RegularExpressions\RegexInterpreterCode.cs (3)
10internal sealed class RegexInterpreterCode(RegexFindOptimizations findOptimizations, RegexOptions options, int[] codes, string[] strings, int trackcount) 15public readonly RegexOptions Options = options; 127sb.AppendLine($"Direction: {((Options & RegexOptions.RightToLeft) != 0 ? "right-to-left" : "left-to-right")}");
System\Text\RegularExpressions\RegexLWCGCompiler.cs (1)
35public RegexRunnerFactory? FactoryInstanceFromCode(string pattern, RegexTree regexTree, RegexOptions options, bool hasTimeout)
System\Text\RegularExpressions\RegexNode.cs (50)
42public RegexOptions Options; 51public RegexNode(RegexNodeKind kind, RegexOptions options) 57public RegexNode(RegexNodeKind kind, RegexOptions options, char ch) 64public RegexNode(RegexNodeKind kind, RegexOptions options, string str) 71public RegexNode(RegexNodeKind kind, RegexOptions options, int m) 78public RegexNode(RegexNodeKind kind, RegexOptions options, int m, int n) 110public static RegexNode CreateOneWithCaseConversion(char ch, RegexOptions options, CultureInfo? culture, ref RegexCaseBehavior caseBehavior) 113if ((options & RegexOptions.IgnoreCase) != 0) 121return new RegexNode(RegexNodeKind.One, options & ~RegexOptions.IgnoreCase, ch); 127return new RegexNode(RegexNodeKind.Set, options & ~RegexOptions.IgnoreCase, stringSet); 137if ((Options & RegexOptions.RightToLeft) != 0 && 315Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 339if ((Options & (RegexOptions.RightToLeft | RegexOptions.NonBacktracking)) == 0) 414(Options & (RegexOptions.RightToLeft | RegexOptions.NonBacktracking)) != 0) 529Options &= ~RegexOptions.IgnoreCase; 600if ((Options & RegexOptions.NonBacktracking) != 0) 644if ((Options & RegexOptions.RightToLeft) == 0) 962RegexOptions optionsLast = 0; 963RegexOptions optionsAt; 1000optionsAt = at.Options & (RegexOptions.RightToLeft | RegexOptions.IgnoreCase); 1048if ((prev.Options & RegexOptions.IgnoreCase) != 0) 1050prev.Options &= ~RegexOptions.IgnoreCase; 1082if ((alternation.Options & RegexOptions.RightToLeft) != 0) 1225if ((alternation.Options & RegexOptions.RightToLeft) != 0) 1240RegexOptions startingNodeOptions = startingNode.Options; 1386Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1396if (node is not null && (node.Options & RegexOptions.RightToLeft) == 0) 1546RegexOptions optionsLast = 0; 1560((at.Options & RegexOptions.RightToLeft) == (Options & RegexOptions.RightToLeft))) 1581RegexOptions optionsAt = at.Options & (RegexOptions.RightToLeft | RegexOptions.IgnoreCase); 1598prev.Str = (optionsAt & RegexOptions.RightToLeft) == 0 ? 1707(nextNode.Options & RegexOptions.RightToLeft) == 0 && // RTL multi nodes don't have their text reversed, and it's not worth the code to optimize further 1798Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 1806if ((Options & RegexOptions.RightToLeft) != 0) 2033if (condition.Kind == RegexNodeKind.PositiveLookaround && (condition.Options & RegexOptions.RightToLeft) == 0) 2075case RegexNodeKind.PositiveLookaround when (subsequent.Options & RegexOptions.RightToLeft) == 0: // only lookaheads, not lookbehinds (represented as RTL PositiveLookaround nodes) 2789if ((Options & RegexOptions.NonBacktracking) != 0) 2880if ((Options & RegexOptions.ExplicitCapture) != 0) sb.Append("-C"); 2881if ((Options & RegexOptions.IgnoreCase) != 0) sb.Append("-I"); 2882if ((Options & RegexOptions.RightToLeft) != 0) sb.Append("-L"); 2883if ((Options & RegexOptions.Multiline) != 0) sb.Append("-M"); 2884if ((Options & RegexOptions.Singleline) != 0) sb.Append("-S"); 2885if ((Options & RegexOptions.IgnorePatternWhitespace) != 0) sb.Append("-X"); 2886if ((Options & RegexOptions.ECMAScript) != 0) sb.Append("-E");
System\Text\RegularExpressions\RegexNodeKind.cs (14)
18/// <summary>Anything other than a specific character, e.g. `.` when not in <see cref="RegexOptions.Singleline"/> mode, or `[^a]`.</summary> 35/// <summary>A loop around anything other than a specific character, e.g. `.*` when not in <see cref="RegexOptions.Singleline"/> mode, or `[^a]*`.</summary> 48/// <summary>A lazy loop around anything other than a specific character, e.g. `.*?` when not in <see cref="RegexOptions.Singleline"/> mode, or `[^a]*?`.</summary> 63/// <summary>An atomic loop around anything other than a specific character, e.g. `(?>.*)` when not in <see cref="RegexOptions.Singleline"/> mode.</summary> 80/// <summary>A beginning-of-line anchor, e.g. `^` in <see cref="RegexOptions.Multiline"/> mode.</summary> 82/// <summary>An end-of-line anchor, e.g. `$` in <see cref="RegexOptions.Multiline"/> mode.</summary> 88/// <summary>A word boundary anchor, e.g. `\b` in <see cref="RegexOptions.ECMAScript"/> mode.</summary> 90/// <summary>Not a word boundary anchor, e.g. `\B` in <see cref="RegexOptions.ECMAScript"/> mode..</summary> 92/// <summary>A beginning-of-string anchor, e.g. `\A`, or `^` when not in <see cref="RegexOptions.Multiline"/> mode.</summary> 96/// <summary>A end-of-string-or-before-ending-newline anchor, e.g. `\Z`, or `$` when not in <see cref="RegexOptions.Multiline"/> mode.</summary> 156/// A positive lookaround assertion: lookahead if <see cref="RegexOptions.RightToLeft"/> is not set and lookbehind if 157/// <see cref="RegexOptions.RightToLeft"/> is set, e.g. `(?=abc)` or `(?&lt;=abc)`.</summary> 161/// A negative lookaround assertion: lookahead if <see cref="RegexOptions.RightToLeft"/> is not set and lookbehind if 162/// <see cref="RegexOptions.RightToLeft"/> is set, e.g. `(?!abc)` or `(?&lt;!abc)`.</summary>
System\Text\RegularExpressions\RegexParser.cs (70)
47private RegexOptions _options; 55private RegexParser(string pattern, RegexOptions options, CultureInfo culture, Hashtable caps, int capsize, Hashtable? capnames, Span<int> optionSpan) 85internal static CultureInfo GetTargetCulture(RegexOptions options) => 87(options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; 90public static RegexOptions ParseOptionsInPattern(string pattern, RegexOptions options) 98parser.CountCaptures(out RegexOptions foundOptionsInPattern); 103public static RegexTree Parse(string pattern, RegexOptions options, CultureInfo culture) 137public static RegexReplacement ParseReplacement(string pattern, RegexOptions options, Hashtable caps, int capsize, Hashtable capnames) 140CultureInfo culture = (options & RegexOptions.CultureInvariant) != 0 ? CultureInfo.InvariantCulture : CultureInfo.CurrentCulture; 223var parser = new RegexParser(input, RegexOptions.None, CultureInfo.InvariantCulture, new Hashtable(), 0, null, stackalloc int[OptionStackDefaultSize]); 257private void Reset(RegexOptions options) 277StartGroup(new RegexNode(RegexNodeKind.Capture, (_options & ~RegexOptions.IgnoreCase), 0, -1)); 290if ((_options & RegexOptions.IgnorePatternWhitespace) != 0) 346string setString = ScanCharClass((_options & RegexOptions.IgnoreCase) != 0, scanOnly: false)!.ToStringClass(); 347_unit = new RegexNode(RegexNodeKind.Set, _options & ~RegexOptions.IgnoreCase, setString); 376_options = (RegexOptions)_optionsStack.Pop(); 394_unit = new RegexNode((_options & RegexOptions.Multiline) != 0 ? RegexNodeKind.Bol : RegexNodeKind.Beginning, _options); 398_unit = new RegexNode((_options & RegexOptions.Multiline) != 0 ? RegexNodeKind.Eol : RegexNodeKind.EndZ, _options); 402_unit = (_options & RegexOptions.Singleline) != 0 ? 403new RegexNode(RegexNodeKind.Set, _options & ~RegexOptions.IgnoreCase, RegexCharClass.AnyClass) : 404new RegexNode(RegexNodeKind.Notone, _options & ~RegexOptions.IgnoreCase, '\n'); 564if ((_options & RegexOptions.ECMAScript) != 0 && _pattern[_pos] == ']') 594charClass!.AddDigit((_options & RegexOptions.ECMAScript) != 0, ch == 'D', _pattern, _pos); 606charClass!.AddSpace((_options & RegexOptions.ECMAScript) != 0, ch == 'S'); 619charClass!.AddWord((_options & RegexOptions.ECMAScript) != 0, ch == 'W'); 756if ((_options & RegexOptions.ExplicitCapture) != 0 || _ignoreNextParen) 788_options &= ~RegexOptions.RightToLeft; 794_options &= ~RegexOptions.RightToLeft; 822_options |= RegexOptions.RightToLeft; 833_options |= RegexOptions.RightToLeft; 1041if ((_options & RegexOptions.IgnorePatternWhitespace) != 0) 1049if ((_options & RegexOptions.IgnorePatternWhitespace) != 0 && _pos < _pattern.Length && _pattern[_pos] == '#') 1096new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.ECMAWordClass : RegexCharClass.WordClass); 1101new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.NotECMAWordClass : RegexCharClass.NotWordClass); 1106new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.ECMASpaceClass : RegexCharClass.SpaceClass); 1111new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.NotECMASpaceClass : RegexCharClass.NotSpaceClass); 1116new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.ECMADigitClass : RegexCharClass.DigitClass); 1121new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), (_options & RegexOptions.ECMAScript) != 0 ? RegexCharClass.NotECMADigitClass : RegexCharClass.NotDigitClass); 1132cc.AddCategoryFromName(ParseProperty(), ch != 'p', (_options & RegexOptions.IgnoreCase) != 0, _pattern, _pos); 1133if ((_options & RegexOptions.IgnoreCase) != 0) 1138return new RegexNode(RegexNodeKind.Set, (_options & ~RegexOptions.IgnoreCase), cc.ToStringClass()); 1142if (result != null && result.Kind == RegexNodeKind.Backreference && (result.Options & RegexOptions.IgnoreCase) != 0) 1212if ((_options & RegexOptions.ECMAScript) != 0) 1314if (!angled && (_options & RegexOptions.ECMAScript) != 0) 1443if ((_options & RegexOptions.ECMAScript) != 0 && i >= 0x20) 1547RegexOptions options = (char)(ch | 0x20) switch 1549'i' => RegexOptions.IgnoreCase, 1550'm' => RegexOptions.Multiline, 1551'n' => RegexOptions.ExplicitCapture, 1552's' => RegexOptions.Singleline, 1553'x' => RegexOptions.IgnorePatternWhitespace, 1554_ => RegexOptions.None, 1609if ((_options & RegexOptions.ECMAScript) == 0 && RegexCharClass.IsBoundaryWordChar(ch)) 1656'b' => (_options & RegexOptions.ECMAScript) != 0 ? RegexNodeKind.ECMABoundary : RegexNodeKind.Boundary, 1657'B' => (_options & RegexOptions.ECMAScript) != 0 ? RegexNodeKind.NonECMABoundary : RegexNodeKind.NonBoundary, 1668private void CountCaptures(out RegexOptions optionsFoundInPattern) 1671optionsFoundInPattern = RegexOptions.None; 1688if ((_options & RegexOptions.IgnorePatternWhitespace) != 0) 1702_options = (RegexOptions)_optionsStack.Pop(); 1773if ((_options & RegexOptions.ExplicitCapture) == 0 && !_ignoreNextParen) 2018_concatenation!.AddChild(RegexNode.CreateOneWithCaseConversion(_pattern[pos], isReplacement ? _options & ~RegexOptions.IgnoreCase : _options, _culture, ref _caseBehavior)); 2021case > 1 when (_options & RegexOptions.IgnoreCase) == 0 || isReplacement || !RegexCharClass.ParticipatesInCaseConversion(_pattern.AsSpan(pos, cch)): 2022_concatenation!.AddChild(new RegexNode(RegexNodeKind.Multi, _options & ~RegexOptions.IgnoreCase, _pattern.Substring(pos, cch)));
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (5)
65(node.Options & RegexOptions.RightToLeft) != 0 || 358bool rtl = (node.Options & RegexOptions.RightToLeft) != 0; 593if ((node.Options & RegexOptions.RightToLeft) != 0) 995cc.AddChar(node.Str![(node.Options & RegexOptions.RightToLeft) != 0 ? node.Str.Length - 1 : 0]); 1105if ((node.Options & RegexOptions.RightToLeft) != 0)
System\Text\RegularExpressions\RegexReplacement.cs (1)
108int capsize, Hashtable capnames, RegexOptions roptions)
System\Text\RegularExpressions\RegexTree.cs (2)
17public readonly RegexOptions Options; 43internal RegexTree(RegexNode root, int captureCount, string[]? captureNames, Hashtable? captureNameToNumberMapping, Hashtable? captureNumberSparseMapping, RegexOptions options, CultureInfo? culture)
System\Text\RegularExpressions\RegexTreeAnalyzer.cs (6)
27results._hasIgnoreCase |= (node.Options & RegexOptions.IgnoreCase) != 0; 28results._hasRightToLeft |= (node.Options & RegexOptions.RightToLeft) != 0; 165/// <summary>Whether any node has <see cref="RegexOptions.IgnoreCase"/> set.</summary> 167/// <summary>Whether any node has <see cref="RegexOptions.RightToLeft"/> set.</summary> 226/// <summary>Gets whether a node might have <see cref="RegexOptions.IgnoreCase"/> set.</summary> 234/// <summary>Gets whether a node might have <see cref="RegexOptions.RightToLeft"/> set.</summary>
System\Text\RegularExpressions\RegexWriter.cs (2)
204if ((node.Options & RegexOptions.RightToLeft) != 0) 208if ((node.Options & RegexOptions.IgnoreCase) != 0)
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (3)
15public SymbolicRegexRunnerFactory(RegexTree regexTree, RegexOptions options, TimeSpan matchTimeout) 17Debug.Assert((options & (RegexOptions.RightToLeft | RegexOptions.ECMAScript)) == 0);
TaskUsageLogger (1)
TaskUsageLogger.cs (1)
47private static readonly Regex s_msbuildPropertyRegex = new Regex(@"[\$][\(](?<name>.*?)[\)]", RegexOptions.ExplicitCapture);
Templates.Blazor.Tests (3)
BlazorWasmTemplateTest.cs (1)
118var serviceWorkerAssetsManifestVersionMatch = new Regex(@"^\s*\""version\"":\s*(\""[^\""]+\"")", RegexOptions.Multiline)
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);
Templates.Blazor.WebAssembly.Auth.Tests (2)
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);
Templates.Blazor.WebAssembly.Tests (2)
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);
Templates.Mvc.Tests (2)
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);
Templates.Tests (2)
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);
VisualBasicSyntaxGenerator (2)
Grammar\GrammarGenerator.vb (2)
351RegexOptions.IgnorePatternWhitespace Or RegexOptions.Compiled)