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

WIP: Allow supplying a Regex object to a RegularExpressionAttribute #101972

Closed

Conversation

mrudat
Copy link

@mrudat mrudat commented May 7, 2024

Closes #101965

TODO:

  • Apply MatchTimeoutInMilliseconds to the Regex object?

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 7, 2024
Copy link
Contributor

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

@mrudat
Copy link
Author

mrudat commented May 7, 2024

@dotnet-policy-service agree

@mrudat mrudat force-pushed the use-regex-with-regular-expression-attribute branch from 24e927e to 862094a Compare May 7, 2024 09:43
{
Regex = regex;
Pattern = regex.ToString();
MatchTimeoutInMilliseconds = 2000;
Copy link
Author

@mrudat mrudat May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Somehow forward MatchTimeoutInMilliseconds to the Regex object; there's a TimeSpan field for the timeout, but no setter.

@huoyaoyuan
Copy link
Member

Thank you for your interest of contribution. Adding new API like methods require going through API review process. Typically pull requests shouldn't be opened before the API is approved.

I'm going to close this PR because it won't work at all. You can't really use the attribute constructor with attribute syntax.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.ComponentModel.DataAnnotations community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Proposal]: Allow supplying a Regex object to a RegularExpressionAttribute
2 participants