From 05bc31aa90f5bf0ca97ba222e570b914b90816b3 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 1 Apr 2025 12:17:42 +0200 Subject: [PATCH] Trim regex to work with yaml pipe --- processor/regex.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/processor/regex.go b/processor/regex.go index 293d84c..d0ec97d 100644 --- a/processor/regex.go +++ b/processor/regex.go @@ -33,6 +33,11 @@ func ProcessRegex(content string, command utils.ModifyCommand, filename string) // We don't HAVE to do this multiple times for a pattern // But it's quick enough for us to not care pattern := resolveRegexPlaceholders(command.Regex) + // I'm not too happy about having to trim regex, we could have meaningful whitespace or newlines + // But it's a compromise that allows us to use | in yaml + // Otherwise we would have to escape every god damn pair of quotation marks + // And a bunch of other shit + pattern = strings.TrimSpace(pattern) logger.Debug("Compiling regex pattern: %s", pattern) patternCompileStart := time.Now()