Werk #17075: Fix regex error when using global flags when matching multiple expressions

Component Setup
Title Fix regex error when using global flags when matching multiple expressions
Date Jun 21, 2024
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
2.4.0b1
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.3.0p8 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.2.0p28 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

There are a few places where we concatenate multiple regular expressions to save performance. This concatenation broke when expressions using global flags such as "(?i)cpu" were concatenated. With this werk, we are converting these global flags to local ones for that specific expression which restores the expected behavior of the expression, fixing various crashes that would occur for example when updating or activating changes.

To the list of all Werks