Skip to content

Issue with regex in 5.0 preview1 #33399

@javiercn

Description

@javiercn

We got reports of dotnet dev-certs not working in 5.0-preview1. I've debugged through the code and determined that the issue was a regex that was failing.

I've investigated and this seems to be a regression in 5.0. Here is a minimal repro between 3.1 and 5.0 that showcases the issue.

/Users/jacalvar/work/repro/regexrepro> dotnet run --framework netcoreapp3.1
True
/Users/jacalvar/work/repro/regexrepro> dotnet run --framework netcoreapp5.0
False
/Users/jacalvar/work/repro/regexrepro> cat ./Program.cs
using System;
using System.Text.RegularExpressions;

namespace regexrepro
{
    class Program
    {
        static void Main(string[] args)
        {
            var result = Regex.Match("CN=localhost", "CN=(.*[^,]+).*", RegexOptions.Singleline, TimeSpan.FromMinutes(1));
            Console.WriteLine(result.Success);
        }
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions