Skip to content

Wrong summary for generated regex #114889

@pawchen

Description

@pawchen

Description

    [GeneratedRegex(@"\b(ifn?def|endif)?")]
    private static partial Regex MyRegex1 { get; }

The summary generated should state it matches the string if before the optional n, but instead it states Match an empty string.:

Image

I examined the generated matching code and it did look for the 'i' then the 'f', so it appears only the summary was wrong.

Reproduction Steps

    [GeneratedRegex(@"\b(ifn?def|endif)?")]
    private static partial Regex MyRegex1 { get; }

Expected behavior

summary should be stated correctly

Actual behavior

summary was wrong

Regression?

No response

Known Workarounds

Don't look at it?

Configuration

VS 17.13.6
.NET 9

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions