Skip to content

Unexpected regex match failure with Compiled and IgnoreCase on net 5 #39390

@timmydo

Description

@timmydo

Description

Console app:

            var x = "x/y ( Hello 7)";
            var y = new Regex("Hello 7", RegexOptions.Compiled | RegexOptions.IgnoreCase);
            var result = y.Match(x);
            Console.WriteLine(RuntimeInformation.FrameworkDescription);
            Console.WriteLine($"{y}.Match({x}) = {result.Success}");

Console output

.NET 5.0.0-preview.8.20361.2
Hello 7.Match(x/y ( Hello 7)) = False

Configuration

win x64

Regression?

yes, from 3.1.x

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions