ktranslate
ktranslate copied to clipboard
[Feature request] Allow negative matches for regex in match_attributes
This request is to provide an equivalent feature to work around the lack of negative lookahead patterns in Golang regex for match_attributes.
Example which doesn't work (container will crash):
match_attributes:
"!if_interface_name": "^(?!foobarbaz\b)\\S+"
It would be great if there was an operator to negate the match.
Example of workaround for this issue in Golang regex: https://regex101.com/library/7lMqca?page=862
Will this work for you @maxlemieux?
match_attributes:
if_interface_name: enp1s0
DOES_NOT_MATCH: true
A long time ago, the DOES_NOT_MATCH
special case was added. It will invert any matches for a match_attributes
block where it is present.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Great! This should work nicely for the purpose.