143 references to new
Aspire.Dashboard (1)
Components\Layout\MobileNavMenu.razor.cs (1)
43LinkMatchRegex: new Regex($"^{DashboardUrls.ResourcesUrl()}$")
Aspire.EndToEnd.Tests (1)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
Aspire.Playground.Tests (1)
AppHostTests.cs (1)
49var tasks = testEndpoints.WaitForTexts.Select(x => app.WaitForTextAsync(log => new Regex(x.Pattern).IsMatch(log), x.ResourceName)).ToArray();
Aspire.Workload.Tests (1)
tests\Shared\WorkloadTesting\TemplateCustomHive.cs (1)
85var packageNameRegex = new Regex($@"{templatePackageId}\.\d+\.\d+\.\d+(-[A-z\.\d]*\.*\d*)?\.nupkg");
BuildBoss (1)
CompilerNuGetCheckerUtil.cs (1)
101var regex = new Regex(@"^(.*?)\.\d.*\.nupkg$");
dotnet-svcutil-lib (7)
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (2)
557new Regex(@"(^(.*)(\(([0-9]+),([0-9]+)\)): )(error|warning) ([A-Z]+[0-9]+) ?: (.*)"); 559new Regex(@"(error|warning) ([A-Z]+[0-9]+) ?: (.*)");
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
18private static Regex s_regex = new Regex("([(][(](?<t>[^)]+)[)])?(?<a>[^[]+)[[](?<ia>.+)[]][)]?"); 20private static Regex s_regex2 = new Regex("[(][(](?<cast>[^)]+)[)](?<arg>[^)]+)[)]");
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (1)
75regex = new Regex(pattern);
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
103s_decodeCharPattern = new Regex("_[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_"); 212s_encodeCharPattern = new Regex("(?<=_)[Xx]([0-9a-fA-F]{4}|[0-9a-fA-F]{8})_");
illink (1)
installer.tasks (1)
StaticFileRegeneration\TpnSectionHeader.cs (1)
14private static readonly Regex NumberListPrefix = new Regex(@"^[0-9]+\.\t(?<name>.*)$");
InteropTests (1)
Helpers\WebsiteProcess.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: .*:(?<port>\d*)$");
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
RazorComponentResultTest.cs (3)
403private static readonly Regex TemplateElementComponentIdRegex = new Regex("blazor-component-id=\"\\d+\""); 404private static readonly Regex OpenBoundaryMarkerRegex = new Regex("<!--bl:\\d+-->"); 405private static readonly Regex CloseBoundaryMarkerRegex = new Regex("<!--/bl:\\d+-->");
Microsoft.AspNetCore.Components.WebView.Maui (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.WindowsForms (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.Components.WebView.Wpf (1)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
20 private readonly static Regex ContentUrlRegex = new Regex("^_content/(?<AssemblyName>[^/]+)/(?<RelativePath>.*)");
Microsoft.AspNetCore.InternalTesting.Tests (4)
AssemblyTestLogTests.cs (3)
362private static readonly Regex TimestampRegex = new(@"\d+-\d+-\d+T\d+:\d+:\d+"); 363private static readonly Regex TimestampOffsetRegex = new(@"\d+\.\d+s"); 364private static readonly Regex DurationRegex = new(@"[^ ]+s$");
XunitLoggerProviderTest.cs (1)
82private static readonly Regex TimestampRegex = new Regex(@"\d+-\d+-\d+T\d+:\d+:\d+");
Microsoft.AspNetCore.Rewrite.Tests (3)
IISUrlRewrite\FileParserTests.cs (3)
57condList.Add(new Condition(new InputParser().ParseInputString("{HTTPS}"), new RegexMatch(new Regex("^OFF$"), false))); 97condList.Add(new Condition(new InputParser().ParseInputString("{HTTPS}"), new RegexMatch(new Regex("^OFF$"), false))); 190new RegexMatch(new Regex("^OFF$"), negate),
Microsoft.AspNetCore.Routing.Tests (3)
Constraints\RegexRouteConstraintTests.cs (3)
49var constraint = new RegexRouteConstraint(new Regex("^abc$")); 68var constraint = new RegexRouteConstraint(new Regex("^abc$")); 87var constraint = new RegexRouteConstraint(new Regex("^abc$"));
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Deployers\SelfHostDeployer.cs (1)
17private static readonly Regex NowListeningRegex = new Regex(@"^\s*Now listening on: (?<url>.*)$");
Microsoft.AspNetCore.Server.IntegrationTesting.IIS (1)
IISExpressDeployer.cs (1)
27private static readonly Regex UrlDetectorRegex = new Regex(@"^\s*Successfully registered URL ""(?<url>[^""]+)"" for site.*$");
Microsoft.Build (3)
Construction\ProjectRootElement.cs (1)
64private static readonly Lazy<Regex> XmlDeclarationRegEx = new Lazy<Regex>(() => new Regex(@"\A\s*\<\?\s*xml.*\?\>\s*\Z"), isThreadSafe: true);
Definition\ToolsetReader.cs (1)
199var r = new Regex(Regex.Escape(xbuildToolsetsDir) + @"\d+\.\d+");
Utilities\Utilities.cs (1)
298private static readonly Regex s_xmlnsPattern = new Regex("xmlns=\"[^\"]*\"\\s*");
Microsoft.Build.BuildCheck.UnitTests (1)
EndToEndTests.cs (1)
216Regex regex = new Regex(@"(\d+) Warning\(s\)");
Microsoft.Build.CommandLine.UnitTests (1)
MSBuildServer_Tests.cs (1)
346Regex regex = new(@$"{toFind}(\d+)");
Microsoft.Build.Engine.UnitTests (1)
BackEnd\SdkResolverService_Tests.cs (1)
728var man = new SdkResolverManifest(DisplayName: "TestResolversManifest", Path: null, ResolvableSdkRegex: new Regex("abc"));
Microsoft.Build.Framework (17)
Logging\AnsiDetector.cs (17)
19new("^xterm"), // xterm, PuTTY, Mintty 20new("^rxvt"), // RXVT 21new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 22new("^screen"), // GNU screen, tmux 23new("tmux"), // tmux 24new("^vt100"), // DEC VT series 25new("^vt102"), // DEC VT series 26new("^vt220"), // DEC VT series 27new("^vt320"), // DEC VT series 28new("ansi"), // ANSI 29new("scoansi"), // SCO ANSI 30new("cygwin"), // Cygwin, MinGW 31new("linux"), // Linux console 32new("konsole"), // Konsole 33new("bvterm"), // Bitvise SSH Client 34new("^st-256color"), // Suckless Simple Terminal, st 35new("alacritty"), // Alacritty
Microsoft.Build.Tasks.Core (2)
BootstrapperUtil\BuildMessage.cs (1)
18private static readonly Regex s_msbuildMessageCodePattern = new Regex(@"(\d+)$");
ManifestUtil\AssemblyIdentity.cs (1)
168Regex re = new Regex("^(?<name>[^,]*)(, Version=(?<version>[^,]*))?(, Culture=(?<culture>[^,]*))?(, PublicKeyToken=(?<pkt>[^,]*))?(, ProcessorArchitecture=(?<pa>[^,]*))?(, Type=(?<type>[^,]*))?");
Microsoft.Build.Utilities.UnitTests (1)
ToolTask_Tests.cs (1)
275Regex regex = new Regex(pattern);
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTrackingDiagnosticAnalyzer.cs (1)
20new Regex(@"Using|Extern|Parameter|Constraint|Specifier|Initializer|Global|Method|Destructor|MemberBindingExpression|ElementBindingExpression|ArrowExpressionClause|NameOfExpression");
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.SingleLineRewriter.cs (1)
16private static readonly Regex s_newlinePattern = new(@"[\r\n]+");
Microsoft.CodeAnalysis.EditorFeatures (3)
EditorConfigSettings\Updater\SettingsUpdateHelper.cs (3)
136private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 152private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 198if ((relativePath.IsEmpty() || new Regex(fileName).IsMatch(relativePath)) &&
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Semantics\SpeculationAnalyzerTestsBase.cs (1)
19protected readonly Regex UnderTestRegex = new Regex(@"\[\|(?<content>.*?)\|\]");
Microsoft.CodeAnalysis.Features (6)
CodeFixes\Configuration\ConfigurationUpdater.cs (4)
46private static readonly Regex s_headerPattern = new(@"\[(\*|[^ #;\[\]]+\.({[^ #;{}\.\[\]]+}|[^ #;{}\.\[\]]+))\]\s*([#;].*)?"); 61private static readonly Regex s_optionEntryPattern = new($@"(.*)=([\w, ]*)(:[\w]+)?([ ]*[;#].*)?"); 595var headerRegex = new Regex(headerRegexStr); 640else if (relativePath.IsEmpty() && new Regex(fileName).IsMatch(relativePath))
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
51private static readonly Regex s_removeEscapedBracketsRegex = new("{{"); 57private static readonly Regex s_extractPlaceholdersRegex = new("{(.*?)}");
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
38private protected static readonly Regex s_timePropertiesRegex = new("[|](EmitDifferenceMilliseconds|TotalAnalysisMilliseconds)=[0-9]+");
Microsoft.CodeAnalysis.LanguageServer.Protocol.UnitTests (1)
Configuration\DidChangeConfigurationNotificationHandlerTest.cs (1)
335var regex = new Regex(s_clientSideSectionPattern);
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\TrackingDiagnosticAnalyzer.cs (1)
67new Regex(@"None|Trivia|Token|Keyword|List|Xml|Cref|Compilation|Namespace|Class|Struct|Enum|Interface|Delegate|Field|Property|Indexer|Event|Operator|Constructor|Access|Incomplete|Attribute|Filter|InterpolatedString");
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
BasicTrackingDiagnosticAnalyzer.vb (1)
10Private Shared ReadOnly s_omittedSyntaxKindRegex As Regex = New Regex(
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SingleLineRewriter.vb (1)
11Private Shared ReadOnly s_newlinePattern As Regex = New Regex("[\r\n]+")
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher_TryParseSection.cs (1)
63matcher = new SectionMatcher(new Regex(pattern), headerText, numberRangePairs.ToImmutableArray());
Microsoft.Data.Analysis.Interactive.Tests (1)
DataFrameInteractiveTests.cs (1)
17private Regex _buttonHtmlPart = new Regex(@"<\s*button.*onclick=.*>");
Microsoft.DotNet.Build.Tasks.Feed (2)
src\BuildModelFactory.cs (1)
79private readonly Regex LegacyRepositoryUriPattern = new Regex(
src\common\AzureConnectionStringBuildTask.cs (1)
39Regex storageConnectionStringRegex = new Regex("AccountName=(?<name>.+?);AccountKey=(?<key>.+?);");
Microsoft.DotNet.Build.Tasks.Installers (1)
src\GenerateCurrentVersion.cs (1)
97Regex regex = new Regex(@"(\d{8})[\-\.](\d+)$");
Microsoft.DotNet.Git.IssueManager (3)
Clients\AzureDevOpsClient.cs (2)
17private static readonly Regex RepositoryUriPattern = new Regex( 20private static readonly Regex LegacyRepositoryUriPattern = new Regex(
Clients\GitHubClient.cs (1)
99Regex repositoryUriPattern = new Regex(@"^/(?<owner>[^/]+)/(?<repo>[^/]+)/?$");
Microsoft.DotNet.Helix.JobSender (3)
JobDefinition.cs (3)
210Regex illegalCharacters = new Regex("[^a-z0-9-]"); 211Regex multipleDashes = new Regex("-{2,}"); 283Match queueInfoSplit = new Regex(@"\((.+?)\)(.*)").Match(queueInfo);
Microsoft.DotNet.Helix.Sdk (1)
ProvisioningProfileProvider.cs (1)
44private static readonly Regex s_topLevelAppPattern = new("^[^" + Regex.Escape(new string(Path.GetInvalidFileNameChars())) + "]+\\.app/.+");
Microsoft.DotNet.SourceBuild.Tasks (2)
src\UsageReport\UsagePattern.cs (1)
43return new Regex("");
src\WriteBuildOutputProps.cs (1)
18private static readonly Regex InvalidElementNameCharRegex = new Regex(@"(^|[^A-Za-z0-9])(?<FirstPartChar>.)");
Microsoft.DotNet.VersionTools.Tasks (3)
BaseDependenciesTask.cs (3)
83new Regex($@"<{elementName}>(?<{contentGroupName}>.*)</{elementName}>"); 86new Regex($@"""{msbuildSdkName}""\s*:\s*""(?<{contentGroupName}>.*)"""); 319updater.Regex = new Regex(manualRegex);
Microsoft.DotNet.XUnitAssert.Tests (5)
StringAssertsTests.cs (5)
379 Assert.DoesNotMatch(new Regex(@"\d"), "Hello"); 385 var ex = Record.Exception(() => Assert.DoesNotMatch(new Regex(@"ll"), "Hello, world!")); 790 Assert.Matches(new Regex(@"\w+"), "Hello"); 802 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), "Hello, world!")); 816 var ex = Record.Exception(() => Assert.Matches(new Regex(@"\d+"), null));
Microsoft.ML.Data (1)
Dirty\IniFileUtils.cs (1)
40Regex numEvaluators = new Regex("Evaluators=([0-9]+)");
Microsoft.ML.GenAI.LLaMA (1)
LlamaTokenizerHelper.cs (1)
52var preTokenizer = new RegexPreTokenizer(new Regex(_re), _specialTokens);
Microsoft.ML.IntegrationTests (1)
ModelFiles.cs (1)
71Assert.Matches(new Regex(@"(\d+)\.(\d+)\.(\d+)(-[dev|ci|preview\.(\d+)\.(\d+)\.(\d+)]){0,1}"), line);
Microsoft.ML.InternalCodeAnalyzer (1)
NameFixProvider.cs (1)
38private static readonly Regex _sections = new Regex(
Microsoft.VisualBasic.Core (4)
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (4)
1204m_DelimiterRegex = New Regex(Builder.ToString(0, Builder.Length - 1)) 1206m_DelimiterWithEndCharsRegex = New Regex(Builder.ToString()) 1348m_BeginQuotesRegex = New Regex(pattern) 1473Private m_WhiteSpaceRegEx As Regex = New Regex("\s")
MSBuildTaskHost (17)
AnsiDetector.cs (17)
19new("^xterm"), // xterm, PuTTY, Mintty 20new("^rxvt"), // RXVT 21new("^(?!eterm-color).*eterm.*"), // Accepts eterm, but not eterm-color, which does not support moving the cursor, see #9950. 22new("^screen"), // GNU screen, tmux 23new("tmux"), // tmux 24new("^vt100"), // DEC VT series 25new("^vt102"), // DEC VT series 26new("^vt220"), // DEC VT series 27new("^vt320"), // DEC VT series 28new("ansi"), // ANSI 29new("scoansi"), // SCO ANSI 30new("cygwin"), // Cygwin, MinGW 31new("linux"), // Linux console 32new("konsole"), // Konsole 33new("bvterm"), // Bitvise SSH Client 34new("^st-256color"), // Suckless Simple Terminal, st 35new("alacritty"), // Alacritty
Roslyn.VisualStudio.Next.UnitTests (1)
UnifiedSettings\UnifiedSettingsTests.cs (1)
287var regex = new Regex("""
SemanticSearch.BuildTask.UnitTests (8)
GenerateFilteredReferenceAssembliesTaskTests.cs (8)
116new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E.*"), IsIncluded: true), 117new ApiPattern(SymbolKindFlags.NamedType, new Regex(@"M\.E`1"), IsIncluded: false)); 161new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 162new ApiPattern(SymbolKindFlags.Method, new Regex(@"I.M1"), IsIncluded: false)); 201new ApiPattern(SymbolKindFlags.NamedType, new Regex(@".*"), IsIncluded: true), 202new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.get_.*"), IsIncluded: false), 203new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.set_.*"), IsIncluded: false), 204new ApiPattern(SymbolKindFlags.Method, new Regex(@"C\.get_P2"), IsIncluded: true));
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\RegularExpressionAttribute.cs (1)
113? new Regex(Pattern)
System.Private.Xml (1)
System\Xml\Schema\FacetChecker.cs (1)
367_derivedRestriction.Patterns.Add(new Regex(Preprocess(_regStr.ToString())));
System.Text.RegularExpressions (1)
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (1)
48Regex whitespaceRegex = new(@"\s");
VersioningWebSite (1)
VersionRouteAttribute.cs (1)
27private static readonly Regex _versionParser = new Regex(@"^(?<lb>[\(\[])?(?<range>\d+(-\d+)?)(?<hb>[\)\]])?$");
xunit.assert (1)
Sdk\Exceptions\ExceptionUtility.cs (1)
25 static readonly Regex transformRegex = new Regex(@"^\s*at (?<method>.*) in (?<file>.*):(line )?(?<line>\d+)$");
xunit.console (1)
common\AssemblyResolution\DependencyContextAssemblyCache.cs (1)
23static readonly Regex RuntimeIdRegex = new Regex(@"(?<os>[A-Za-z0-9]+)(\.(?<version>[0-9\.]+))?(?<arch>\-[A-Za-z0-9]+)?(?<extra>\-[A-Za-z0-9]+)?");