fmf
fmf copied to clipboard
Add operator for REGEX matching in context
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
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
- always save the matches by their group
This could be particularly useful in combination with #227
The regex_match
sounds like a useful feature. But it will need some discussion as for now the dimension values can only be list of strings, not dictionaries. Let's start small. I've implemented the basic support for the regular expression matching in #272. We can extend the functionality later.