diff --git a/pkg/conversion/convert.go b/pkg/conversion/convert.go index 8035a2e..75f7a86 100644 --- a/pkg/conversion/convert.go +++ b/pkg/conversion/convert.go @@ -371,7 +371,7 @@ func convertWindupWhenToAnalyzer(windupWhen windup.When, where map[string]string //} condition := map[string]interface{}{ "builtin.filecontent": map[string]interface{}{ - "pattern": convertWindupRegex(substituteWhere(where, fc.Pattern)), + "pattern": convertWindupRegex(substituteWhere(where, escapeParens(fc.Pattern))), "filePattern": escapeDots(convertWindupRegex(substituteWhere(where, fc.Filename))), }, } @@ -976,3 +976,9 @@ func convertWindupRegex(regex string) string { } return regex } + +func escapeParens(s string) string { + s = strings.Replace(s, "(", "\\(", -1) + s = strings.Replace(s, ")", "\\)", -1) + return s +}