From 73978a702c86c91884c6e51258f9a4212491ba54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Gim=C3=A9nez?= Date: Sat, 11 Mar 2023 19:43:42 +0900 Subject: [PATCH] Regex cleanup --- pkg/nip/nip_parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/nip/nip_parser.go b/pkg/nip/nip_parser.go index 830a3dd..3b1c4a8 100644 --- a/pkg/nip/nip_parser.go +++ b/pkg/nip/nip_parser.go @@ -9,9 +9,9 @@ import ( var ( errEmptyLine = errors.New("empty line") - operandRegex = regexp.MustCompile("(\\|{2}|\\&{2})") - comparableRegex = regexp.MustCompile("(\\={2}|\\<\\=|\\>\\=|\\>|\\<|\\!\\=)") - propertyNameRegex = regexp.MustCompile("\\[(.*)\\]") + operandRegex = regexp.MustCompile(`(\|{2}|\&{2})`) + comparableRegex = regexp.MustCompile(`(\={2}|\<\=|\>\=|\>|\<|\!\=)`) + propertyNameRegex = regexp.MustCompile(`\[(.*)\]`) ) func parseLine(line string) (Rule, error) {