177 references to Regex
Aspire.Dashboard (1)
Components\Layout\MobileNavMenu.razor.cs (1)
111return new Regex($"^({pageRelativeBasePath}|{pageRelativeBasePath}/.+)$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
Aspire.Hosting.Integration.Analyzers (1)
AspireExportAnalyzer.cs (1)
22private static readonly Regex s_exportIdPattern = new(
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
20private static readonly Regex s_dashboardUrlRegex = new(@"Login to the dashboard at (?<url>.*)", RegexOptions.Compiled);
CSharpSyntaxGenerator (1)
Grammar\GrammarGenerator.cs (1)
371private static readonly Regex s_normalizationRegex = new(
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);
GenerateDocumentationAndConfigFiles (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\EmbeddedLanguageCommentDetector.cs (1)
29_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})\b((\s*,\s*)(?<option>[a-zA-Z]+))*",
Microsoft.Build (3)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
127new Regex(sb.ToString(), RegexOptions.Compiled),
Globbing\MSBuildGlob.cs (1)
218Regex newRegex = new Regex(matchFileExpression, regexOptions);
Utilities\EngineFileUtilities.cs (1)
577Regex item = new Regex(regex, RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase);
Microsoft.Build.Framework (3)
Telemetry\CrashTelemetry.cs (1)
171private static readonly Regex FilePathPattern = new(
Utilities\FileMatcher.cs (2)
1511regexFileMatch = new Regex(matchFileExpression, DefaultRegexOptions); 2174matchWithRegex ? new Regex(RegularExpressionFromFileSpec(oldFixedDirectoryPart, wildcardDirectoryPart, filenamePart), RegexOptions.IgnoreCase) : null,
Microsoft.Build.Tasks.CodeAnalysis (7)
src\roslyn\src\Compilers\Core\MSBuildTask\CanonicalError.cs (7)
54private static readonly Regex s_originCategoryCodeTextExpression = new Regex 76private static readonly Regex s_filenameLocationFromOrigin = new Regex(@" 88private static readonly Regex s_lineFromLocation = new Regex(@" 96private static readonly Regex s_lineLineFromLocation = new Regex(@" 106private static readonly Regex s_lineColFromLocation = new Regex(@" 116private static readonly Regex s_lineColColFromLocation = new Regex(@" 128private static readonly Regex s_lineColLineColFromLocation = new Regex(@"
Microsoft.Build.Tasks.Core (1)
AssemblyDependency\AssemblyFoldersFromConfig\AssemblyFoldersFromConfigResolver.cs (1)
27() => new Regex(
Microsoft.Build.Utilities.Core (2)
CommandLineBuilder.cs (2)
158new Regex(_quoteHyphens ? s_definitelyNeedQuotesRegexWithHyphen : s_definitelyNeedQuotesRegexNoHyphen, RegexOptions.CultureInvariant); 164new Regex(_quoteHyphens ? s_allowedUnquotedRegexNoHyphen : s_allowedUnquotedRegexWithHyphen, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
Microsoft.CodeAnalysis (2)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
119var regex = s_regexMap.GetOrAdd(pattern, static pattern => new(pattern, RegexOptions.Compiled));
SourceGeneration\AdditionalSourcesCollection.cs (1)
27private static readonly Regex s_invalidSegmentPattern = new Regex(@"(\.{1,2}|/|^| )/", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Analyzers (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.CodeAnalysis.AnalyzerUtilities (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CodeStyle (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp (1)
Symbols\Synthesized\GeneratedNameParser.cs (1)
210private static readonly Regex s_fileTypeOrdinalPattern = new Regex(s_regexPatternString, RegexOptions.Compiled);
Microsoft.CodeAnalysis.CSharp.Features (3)
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
250public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 252public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 254public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.CodeAnalysis.Features (3)
ConvertNumericLiteral\AbstractConvertNumericLiteralCodeRefactoringProvider.cs (1)
25private readonly Regex _regex = new($"({hexPrefix}|{binaryPrefix})?([_0-9a-f]+)(.*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
EmbeddedLanguages\EmbeddedLanguageCommentDetector.cs (1)
28_regex = new Regex($@"^((//)|(')|(/\*))\s*lang(uage)?\s*=\s*(?<identifier>{namePortion})(?!\w)((\s*,\s*)(?<option>[a-z]+))*",
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
208new(
Microsoft.CodeAnalysis.ResxSourceGenerator (7)
AbstractResxGenerator.cs (2)
864private static readonly Regex _namedParameterMatcher = new(@"\{([a-z]\w*)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 865private static readonly Regex _numberParameterMatcher = new(@"\{(\d+)\}", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Microsoft.CodeAnalysis.Workspaces (7)
Rename\RenameUtilities.cs (1)
330return new Regex(matchString, RegexOptions.CultureInvariant);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
Workspace\Solution\ProjectInfo.cs (1)
433private static readonly Regex s_projectNameAndFlavor = new(@"^(?<name>.*?)\s*\((?<flavor>.*?)\)$", RegexOptions.Compiled);
Microsoft.Data.Analysis (3)
TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.Data.Analysis.Tests (3)
src\Microsoft.Data.Analysis\TextFieldParser.cs (3)
308_beginQuotesRegex = new Regex(pattern, RegexOptions.CultureInvariant); 1015_delimiterRegex = new Regex(builder.ToString(0, builder.Length - 1), (RegexOptions)512); 1017_delimiterWithEndCharsRegex = new Regex(builder.ToString(), (RegexOptions)512);
Microsoft.DotNet.ApiCompat.Task (1)
src\sdk\src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\RegexStringTransformer.cs (1)
34_patterns[i] = (new Regex(rawPatterns[i].CaptureGroupPattern, RegexOptions.Compiled), rawPatterns[i].ReplacementString);
Microsoft.DotNet.Arcade.Sdk (2)
src\GenerateResxSource.cs (2)
489private static readonly Regex _namedParameterMatcher = new Regex(@"\{([a-z]\w+)\}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 490private static readonly Regex _numberParameterMatcher = new Regex(@"\{(\d+)\}", RegexOptions.Compiled);
Microsoft.DotNet.Build.Tasks.Installers (1)
src\CreateWixBuildWixpack.cs (1)
642var regex = new Regex(@"<\?include\s+([^\s\?>]+)\s*\?>", RegexOptions.IgnoreCase);
Microsoft.DotNet.HotReload.Utils.Generator (1)
EditAndContinueCapabilitiesParser.cs (1)
12static public readonly Regex capabilitiesTokenizer = new (@"^\s*(?:(\S+)\s+)*(\S+)?$", RegexOptions.CultureInvariant);
Microsoft.DotNet.ProjectTools (3)
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (3)
251public static Regex Whitespace { get; } = new Regex("""\s+""", RegexOptions.Compiled); 253public static Regex DisallowedNameCharacters { get; } = new Regex("""[\s@=/]""", RegexOptions.Compiled); 255public static Regex EscapedCompilerOption { get; } = new Regex("""^/\w+:".*"$""", RegexOptions.Compiled | RegexOptions.Singleline);
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\UsagePattern.cs (2)
30return new Regex(IdentityRegex, RegexOptions.IgnoreCase | RegexOptions.Compiled); 38return new Regex(
Microsoft.DotNet.XliffTasks (1)
StringExtensions.cs (1)
37private static readonly Regex s_placeholderRegex = new(@"\{(\d+)(\,\-?\d+)?(\:[^\}]+)?\}", RegexOptions.Compiled);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
860private static readonly Regex _invalidAuthorNameRegex = new(InvalidAuthorNamePattern, RegexOptions.Compiled);
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.Metrics (3)
Emitter.cs (1)
19private static readonly Regex _regex = new("[:.-]+", RegexOptions.Compiled);
Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
25private static readonly Regex _regex = new("^[A-Z]+[A-za-z0-9]*$", RegexOptions.Compiled); 26private static readonly Regex _regexTagNames = new("^[A-Za-z_]+[A-Za-z0-9_.:-]*$", RegexOptions.Compiled);
Microsoft.Maui.Controls (1)
ShadowTypeConverter.cs (1)
58 var regex = new Regex(@"
Microsoft.Maui.Controls.DesignTools (2)
ColorDesignTypeConverter.cs (2)
180 static readonly Lazy<Regex> RxColorHex = new(() => new Regex(RxColorHexPattern, RegexOptions.Compiled | RegexOptions.Singleline)); 189 static readonly Lazy<Regex> RxFuncExpr = new(() => new Regex(RxFuncPattern, RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline));
Microsoft.Maui.Resizetizer (1)
Utils.cs (1)
13 = new Regex(@"^[a-z]([a-z0-9_]*[a-z0-9])?$", RegexOptions.Singleline | RegexOptions.Compiled);
Microsoft.ML.Core (1)
ComponentModel\ComponentCatalog.cs (1)
963private static readonly Regex _nameRegex = new Regex(@"^\w[_\.\w]*$", RegexOptions.Compiled);
Microsoft.ML.Core.Tests (1)
UnitTests\TestEntryPoints.cs (1)
337var regex = new Regex(@"\r\n?|\n", RegexOptions.Compiled);
Microsoft.ML.Data (11)
EntryPoints\EntryPointNode.cs (2)
430private static readonly Regex _stageIdRegex = new Regex(@"[a-zA-Z0-9]*", RegexOptions.Compiled); 1063private static readonly Regex _variableRegex = new Regex(
Evaluators\MulticlassClassificationEvaluator.cs (2)
134isVector: true, namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", LogLoss), RegexOptions.IgnoreCase), 1029namePattern: new Regex(string.Format(@"^{0}(?<class>.+)", MulticlassClassificationEvaluator.LogLoss), RegexOptions.IgnoreCase));
Evaluators\MultiOutputRegressionEvaluator.cs (4)
82isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L1), RegexOptions.IgnoreCase), 85isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", L2), RegexOptions.IgnoreCase), 88isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Rms), RegexOptions.IgnoreCase), 91isVector: true, namePattern: new Regex(string.Format(@"{0}_(?<label>\d+)\)", Loss), RegexOptions.IgnoreCase),
Evaluators\RankingEvaluator.cs (3)
148namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Ndcg), RegexOptions.IgnoreCase), 151namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", Dcg), RegexOptions.IgnoreCase), 154namePattern: new Regex(string.Format(@"^{0}@(?<at>\d+)", MaxDcg), RegexOptions.IgnoreCase),
Microsoft.ML.Predictor.Tests (1)
CompareBaselines.cs (1)
116private static readonly Regex _matchIter = new Regex(@"^Iter [0-9]+:", RegexOptions.Compiled);
Microsoft.ML.ResultProcessor (4)
ResultProcessor.cs (4)
364private static readonly Regex _rxNameValue = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)", RegexOptions.Compiled); 365private static readonly Regex _rxNameValueDeviation = new Regex(@"(?<name>.+)\s*:\s*(?<value>\S+)\s*\((?<deviation>\S+)\)", RegexOptions.Compiled); 366private static readonly Regex _rxTimeElapsed = new Regex(@"(?<executionDate>.*)\t Time elapsed\(s\): (?<timeElapsed>[\d\.]*)", RegexOptions.Compiled); 367private static readonly Regex _rxMemoryUsage = new Regex(@"(?<memoryType>[\w]+) memory usage\(MB\): (?<memoryUsage>[\d]*)", RegexOptions.Compiled);
Microsoft.ML.TestFramework (32)
BaseTestBaseline.cs (32)
68private static readonly Regex _matchNumbers = new Regex(@"-?\b[0-9]+\.?[0-9]*(E[-+][0-9]*)?\b", RegexOptions.IgnoreCase | RegexOptions.Compiled); 301private static readonly Regex _matchDataRoot = new Regex(DataRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 302private static readonly Regex _matchDataUnixRoot = new Regex(DataRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 303private static readonly Regex _matchSamplesRoot = new Regex(SamplesRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 304private static readonly Regex _matchSamplesUnixRoot = new Regex(SamplesRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 305private static readonly Regex _matchSourceRoot = new Regex(SourceRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 306private static readonly Regex _matchSourceUnixRoot = new Regex(SourceRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 307private static readonly Regex _matchTestsRoot = new Regex(TestsRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 308private static readonly Regex _matchOutputRoot = new Regex(OutputRootRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 309private static readonly Regex _matchOutputUnixRoot = new Regex(OutputRootUnixRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 310private static readonly Regex _matchTL = new Regex(@"[a-z]:\\[a-z0-9_\.\\]+\\TL.exe", RegexOptions.IgnoreCase | RegexOptions.Compiled); 311private static readonly Regex _matchTempFile = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]*\.tmp", RegexOptions.IgnoreCase | RegexOptions.Compiled); 312private static readonly Regex _matchTempDir = new Regex(@"[a-z]:\\users\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+\\", RegexOptions.IgnoreCase | RegexOptions.Compiled); 313private static readonly Regex _matchTempUnixDir = new Regex(@"\/(var\/)?tmp" + @"\/[^\\\t ]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 314private static readonly Regex _matchTempDirServiceProfile = new Regex(@"[a-z]:\\Windows\\ServiceProfiles\\[a-z0-9_\.]+\\appdata\\local\\temp\\[a-z0-9_\.\\]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 315private static readonly Regex _matchTempWindows = new Regex(@"[a-z]:\\Windows\\Temp\\[a-z0-9_\.]+", RegexOptions.IgnoreCase | RegexOptions.Compiled); 316private static readonly Regex _matchDateTime = new Regex(@"[0-9]{1,4}[-/][0-9]{1,2}[-/][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,4}(\.[0-9]+)?( *[AP]M)?", RegexOptions.IgnoreCase | RegexOptions.Compiled); 317private static readonly Regex _matchTime = new Regex(@"[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?", RegexOptions.Compiled); 318private static readonly Regex _matchShortTime = new Regex(@"\([0-9]{2}:[0-9]{2}(\.[0-9]+)?\)", RegexOptions.Compiled); 319private static readonly Regex _matchMemory = new Regex(@"memory usage\(MB\): [0-9]+", RegexOptions.Compiled); 320private static readonly Regex _matchReservedMemory = new Regex(@": [0-9]+ bytes", RegexOptions.Compiled); 321private static readonly Regex _matchElapsed = new Regex(@"Time elapsed\(s\): [0-9.]+", RegexOptions.Compiled); 322private static readonly Regex _matchTimes = new Regex(@"Instances caching time\(s\): [0-9\.]+", RegexOptions.Compiled); 323private static readonly Regex _matchUpdatesPerSec = new Regex(@", ([0-9\.]+|Infinity)M WeightUpdates/sec", RegexOptions.Compiled); 324private static readonly Regex _matchParameterT = new Regex(@"=PARAM:/t:[0-9]+", RegexOptions.Compiled); 325private static readonly Regex _matchInfinity = new Regex(@"\u221E", RegexOptions.Compiled); 326private static readonly Regex _matchErrorLog = new Regex(@"Error_[\w-]+\.log", RegexOptions.Compiled); 327private static readonly Regex _matchGuid = new Regex(@"[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}", RegexOptions.IgnoreCase | RegexOptions.Compiled); 328private static readonly Regex _matchBin = new Regex(_binRegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 329private static readonly Regex _matchUnixBin = new Regex(_binRegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 330private static readonly Regex _matchBin64 = new Regex(_bin64RegExp, RegexOptions.IgnoreCase | RegexOptions.Compiled); 331private static readonly Regex _matchUnixBin64 = new Regex(_bin64RegUnixExp, RegexOptions.IgnoreCase | RegexOptions.Compiled);
Microsoft.ML.Tokenizers (3)
Model\SentencePieceBaseModel.cs (1)
51SpecialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
PreTokenizer\CompositePreTokenizer.cs (1)
58list.Add(new RegexPreTokenizer(new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled), null));
PreTokenizer\RegexPreTokenizer.cs (1)
39_specialTokensRegex = new Regex(string.Join("|", specialTokens.Keys.Select(s => Regex.Escape(s))), RegexOptions.Compiled);
Microsoft.NET.Sdk.Publish.Tasks (2)
MsDeploy\VsMSDeployObject.cs (1)
189RegularExpressions.Regex match = new(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase);
WebConfigTelemetry.cs (1)
14() => new Regex
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
UpdateExternallyDefinedStaticWebAssets.cs (1)
198var regex = new Regex(pattern, regexOptions);
Microsoft.TestPlatform.CoreUtilities (1)
Utilities\TimeSpanParser.cs (1)
11static readonly Regex Pattern = new(@"(?<value>^\d+(?:\.\d+)?)\s*(?<suffix>ms|mil|m|h|d|s?[a-z]*)$", RegexOptions.IgnoreCase);
Microsoft.VisualStudio.TestPlatform.Common (1)
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpressionWrapper.cs (1)
82FastFilter.PropertyValueRegex = new Regex(regexString, RegexOptions.Compiled);
Microsoft.Web.XmlTransform (1)
XmlElementContext.cs (1)
300nameAndArgumentsRegex = new Regex(@"\A\s*(?<name>\w+)(\s*\((?<arguments>.*)\))?\s*\Z", RegexOptions.Compiled|RegexOptions.Singleline);
NuGet.Common (1)
PathUtil\PathResolver.cs (1)
99return new Regex('^' + pattern + '$', RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture | RegexOptions.CultureInvariant);
NuGet.Configuration (1)
Proxy\WebProxy.cs (1)
84.Select(x => new Regex(x, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant))
NuGet.Packaging (3)
Licenses\LicenseExpressionTokenizer.cs (1)
13private static readonly Regex ValidCharactersRegex = new Regex("^[a-zA-Z0-9\\.\\-\\s\\+\\(\\)]+$", RegexOptions.CultureInvariant);
Licenses\NuGetLicense.cs (1)
89var regex = new Regex("^[a-zA-Z0-9\\.\\-]+$", RegexOptions.CultureInvariant);
Signing\Content\KeyPairFileReader.cs (1)
14private static readonly Regex NamePattern = new Regex("^[a-zA-Z0-9\\.\\-/]+$", RegexOptions.CultureInvariant);
QuarantineTools.Tests (6)
ActiveIssueTests.cs (2)
184Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[ActiveIssue", RegexOptions.Multiline), norm); 186Assert.Matches(new Regex(@"\[Fact\]\n\s+\[ActiveIssue\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
QuarantineScriptTests.cs (4)
196var rx1 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M1\(\)", RegexOptions.Multiline); 197var rx2 = new Regex(@"\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/11""\)\]\n\s*public void M2\(\)", RegexOptions.Multiline); 217Assert.DoesNotMatch(new Regex(@"\[Fact\]\n\s*\n\s*\[QuarantinedTest", RegexOptions.Multiline), norm); 219Assert.Matches(new Regex(@"\[Fact\]\n\s+\[QuarantinedTest\(""https://github.com/microsoft/aspire/issues/99""\)\]", RegexOptions.Multiline), norm);
Roslyn.Diagnostics.Analyzers (5)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (2)
16private static readonly Regex s_sectionMatcher = new(@"^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$", RegexOptions.Compiled); 18private static readonly Regex s_propertyMatcher = new(@"^\s*([\w\.\-_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$", RegexOptions.Compiled);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (3)
17private static readonly Regex s_multiFileWithDotOutside = new(@"\*\.\{(.*)\}", RegexOptions.Compiled); 18private static readonly Regex s_multiFileWithDotInside = new(@"\*\{(.*)\}", RegexOptions.Compiled); 19private static readonly Regex s_fileExtensionMatcher = new(@"([^,]+)", RegexOptions.Compiled);
sdk-tasks (1)
ZipFileCreateFromDirectory.cs (1)
70regexes[i] = new Regex(ExcludePatterns[i].ItemSpec, RegexOptions.IgnoreCase);
System.Configuration.ConfigurationManager (1)
System\Configuration\RegexStringValidator.cs (1)
18_regex = new Regex(regex, RegexOptions.Compiled);
System.Data.Common (1)
System\Data\Common\DBCommandBuilder.cs (1)
47_parameterNameParser = new Regex(_dbCommandBuilder.ParameterNamePattern!, RegexOptions.ExplicitCapture | RegexOptions.Singleline);
System.DirectoryServices.AccountManagement (1)
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (1)
337regex = new Regex(SAMUtils.PAPIQueryToRegexString(wildcardFilter), RegexOptions.Singleline);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
341regexBypassList[i] = new Regex((string)bypassList[i]!, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Regex.Match.cs (1)
329/// <see cref="Regex"/> object with the <see cref="Regex(string, RegexOptions)"/> constructor and calling