I'm using re2 regex to match and negate as in the this link
Following are each possible inputs
- abcd-st-ed-qrew
- ktm-ewe-abcd-st-ed-qrew
- abcd-st-wer-qrew-wabe
- ktm-ewe-abcd-st-qrew-qrrt
The conditions are:
- If string starts with
abcd-
then, it should negate (shouldn't contain)-ed
- If string starts with
ktm-
and also contains-abcd-
then, it should negate (shouldn't contain)-ed
The regex should omit for 1st and 2nd inputs since it contains -ed
. should pass 3rd and 4th inputs
The regex in reference link passed for the match cases of both conditions but not working for negating (not contain) things. Hope need some tweak to negate.
Note: This is for regex on prometheus data in grafana. That's why I'm tagging those too.