Steps to reproduce:
Create a template containing discovery and trigger expression using find function and regexp together with context macro, eq:
Add this template to host manually and trigger expression gets added correctly under the discovery.
Now create autoregistration action to automatically add a new host and create operation that adds previously created template to new host. Register host and observe the trigger expression added by the template, it looks like this with the extra backslashes:
Which effectively means that LDDMACRO isn't expanded and regexp fails.
For some reason autoregistration adds extra backslashes to trigger expression found from template. I skipped 5.4 and went directly from 5.0 -> 6.0 so not sure if it was introduced with new trigger expressions in 5.4 or later on in 6.0. My current environment is running latest 6.0.2 version.
Trigger expression remains unchanged no matter how the template is added to a host.