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

Support regular expression constraints for strings #177

Closed
HassanAkbar opened this issue Nov 19, 2024 · 6 comments
Closed

Support regular expression constraints for strings #177

HassanAkbar opened this issue Nov 19, 2024 · 6 comments
Assignees

Comments

@HassanAkbar
Copy link
Member

No description provided.

@HassanAkbar HassanAkbar self-assigned this Nov 19, 2024
@HassanAkbar
Copy link
Member Author

@ronaldtse Is this implemented by #158? Or do we also need something else here?

@ronaldtse
Copy link
Contributor

@HassanAkbar actually you're right. However I was wondering if we should support multiple regular expressions, perhaps through value: [ /regex1/, /regex2/ ...] ?

@HassanAkbar
Copy link
Member Author

@ronaldtse Multiple regexes can be handled in the regex by separating them using |. So, do we need to support that as a separate feature and handle it in code?
If yes then I think it should be handled by the pattern, as it is already being used to handle a single regex. We can support something like pattern: [ /regex1/, /regex2/ ...].

What do you suggest?

@ronaldtse ronaldtse changed the title lutaml-model with regular expression constraints for strings Support regular expression constraints for strings Jan 2, 2025
@ronaldtse
Copy link
Contributor

Combining multiple regexes is not always easy:

We can start with 1 regex first and see if we ever get the need to do more.

@HassanAkbar
Copy link
Member Author

@ronaldtse We are supporting single regex in the pattern option: pattern: /regex/
Is there anything else we need to do in this ticket?

@ronaldtse
Copy link
Contributor

Nothing we need to do now. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants