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

Add operator for REGEX matching in context #226

Open
lukaszachy opened this issue Mar 7, 2024 · 1 comment
Open

Add operator for REGEX matching in context #226

lukaszachy opened this issue Mar 7, 2024 · 1 comment
Labels
context enhancement New feature or request

Comments

@lukaszachy
Copy link
Collaborator

Add two operators:
~ for match
!~ for not match

Note we have ~= and similar for "major version" comparison.
However since ~ is used in tmt hardware it make sense to use such symbol here as well

@lukaszachy lukaszachy added enhancement New feature or request context labels Mar 7, 2024
@LecrisUT
Copy link
Contributor

LecrisUT commented Mar 9, 2024

Let me add to this, the regex matches should be exposed as context objects:

  • by default all regex matches should be stored under a regex_match context
  • for clarity, the regex should only be allowed to match once so regex_match is singular valued
  • regex match groups are stored as the dictionary of regex_match
    • always save the matches by their group int keys
    • if the group is named, include the str key-values
    • there is always the match group 0 that is the full regex match

This could be particularly useful in combination with #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants