Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider emitting unicode escape sequences for character ranges in the regex source generator #103840

Closed
JakeYallop opened this issue Jun 21, 2024 · 5 comments · Fixed by #103851
Assignees
Labels
area-System.Text.RegularExpressions in-pr There is an active PR which will close this issue when it is merged

Comments

@JakeYallop
Copy link
Contributor

JakeYallop commented Jun 21, 2024

Given the following code, containing a regex with 2 non-ascii ranges (the actual ranges are not important, as long as they are not ASCII):

[GeneratedRegex("[\u00C0-\u00FF\u0104-\u02D9]")]
private static partial Regex GetRegex();

The regex source generator outputs this:

image

This is actually '\0' and '\u007F', but its impossible to tell from looking at the code, I had to open the file up in a hex editor to view what these characters actually were.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jun 21, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-text-regularexpressions
See info in area-owners.md if you want to be subscribed.

@danmoseley
Copy link
Member

For the second one could you open a second issue?

@JakeYallop
Copy link
Contributor Author

JakeYallop commented Jun 21, 2024

Raised #103842, and updated the original comment.

@stephentoub
Copy link
Member

Thanks. I have fixes for both.

@stephentoub stephentoub self-assigned this Jun 22, 2024
@stephentoub stephentoub added the in-pr There is an active PR which will close this issue when it is merged label Jun 22, 2024
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged by the area owner label Jun 22, 2024
@danmoseley
Copy link
Member

@JakeYallop thanks again and please do open issues for any other regex generator oddities or perf opportunities.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Text.RegularExpressions in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants