dear @mrpasini , thank you for the reply.
My problem is not with the regex per se (I put the above rule as a toy example). Changing the regex rule won't solve my problem because the issue on the variable search in general.
Why is the search not working on the variables while it perfectly works on the system clipboard?
Please always post an actual macro demonstrating your issue.
Not doing so puts too much burden upon those who might want to help and makes them guess about conditions that would be solidly provided by a proper test-case.
Guessing often wastes everyone's time.
Your image above shows the SYSTEM-Clipboard rather than a variable or a NAMED-Clipboard, so we can't tell what you're actually doing.
My test-case in Keyboard Maestro 10 shows search/replace working equally well in a variable and a named clipboard. (I also tested the system clipboard separately for good measure.)
Your regular expression doesn't need a linefeed character, as the EOL ($) will always precede it.