Adding message filters to the ESA will help confirm if the syntax is correct, it would also display what line the error is generated for.
Since the filter is not active till you commit changes this would be an easy way to test.
Another method would be create a content filter and use that to view the syntax rules.
In the above there are issues with quotes and custom header cannot have spaces.
External: if (header("from") == "(?i)(morning.alerts@exmaple.com\\.com|anirudh.ken@example\\.com|survey.ECIL@exmaple.com)") {
insert-header("X-custom-header", "");
}
Regards,
Libin