Service template if match service name


I’d like to enable/disable perfdata for specific services.
I now have a service template “generic-service” where I want to check the Service Name of the Service Object for a specific String and if this matches, set enable_perfdata to false.

What does NOT work is the following:

  if(match("*XX]", {
       enable_perfdata  = false

How would I check the Service Name for that string or do we have a better solution to this?