Skip to content

Regex.Match fails for the .* pattern when startat is non-zero #42390

@slozier

Description

@slozier

Description

Regex.Match fails for .* pattern when startat is non-zero. I would expect the following to succeed but it does not.

Debug.Assert(new Regex(".*").Match("abc", startat: 1).Success);

Configuration

.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.1.20452.10
Commit: 473d1b592e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.1.20452.10\

Host (useful for support):
Version: 5.0.0-rc.1.20451.14
Commit: 38017c3

Regression?

This works in .NET Core 3.1 and .NET Framework.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions