[#ZBX-18474] Regex patterns used within macros could have unexpected results (Template Module Windows Services)
Steps to reproduce:
- Configuration -> Templates -> Template Module Windows Services -> Macros
- View definition for {$SERVICE.NAME.NOT_MATCHES} macro
Result:
I believe the intent of the regular expression is “Match any of the following strings as long as they take up the entire line/string”.
However, the anchors (^$) bind tighter than the alternation (|), so the “start of string” anchor only binds to the first service name, and the “end of string” anchor only binds to the last service name. Surely this isn’t what’s intended.
Expected:
^(?:service1|service2|service3)$
Read more here: Source link
