Skip to content

Commit 48cbb29

Browse files
authored
Add regex evaluation timeout (#404)
1 parent 7f137fe commit 48cbb29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xunit.runner.visualstudio/Utility/RunSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public bool IsMatchingTargetFramework()
233233
}
234234

235235
// This should match .NET versions like 'net6.0' but not .NET Framework version like 'net462'.
236-
static readonly Regex regexNet5Plus = new(@"^net\d+\.\d+$");
236+
static readonly Regex regexNet5Plus = new(@"^net\d+\.\d+$", RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.IgnoreCase, TimeSpan.FromSeconds(1));
237237

238238
static bool IsNetCore(string targetFrameworkVersion) =>
239239
targetFrameworkVersion.StartsWith(".NETCoreApp,", StringComparison.OrdinalIgnoreCase) ||

0 commit comments

Comments
 (0)