From 239b5678dc3d2520a04d5952df911c4bcde9dbb5 Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 14 Nov 2017 08:43:11 +0100 Subject: [PATCH] Using MetaPipe (*|) as in-filter separator --- utils/consts.go | 2 +- utils/rsrfield.go | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/utils/consts.go b/utils/consts.go index e864b7aa5..ac8c9f21c 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -147,7 +147,7 @@ const ( CSV_SEP = ',' FALLBACK_SEP = ';' INFIELD_SEP = ";" - SUBFIELD_SEP = "|" + MetaPipe = "*|" FIELDS_SEP = "," InInFieldSep = ":" STATIC_HDRVAL_SEP = "::" diff --git a/utils/rsrfield.go b/utils/rsrfield.go index c2b15bdba..9ce3bf0dc 100644 --- a/utils/rsrfield.go +++ b/utils/rsrfield.go @@ -36,7 +36,7 @@ func NewRSRField(fldStr string) (fld *RSRField, err error) { return nil, fmt.Errorf("Invalid FilterStartValue in string: %s", fldStr) } fltrVal := fldStr[fltrStart+1 : len(fldStr)-1] - filters, err = ParseRSRFilters(fltrVal, SUBFIELD_SEP) + filters, err = ParseRSRFilters(fltrVal, MetaPipe) if err != nil { return nil, fmt.Errorf("Invalid FilterValue in string: %s, err: %s", fltrVal, err.Error()) } @@ -147,16 +147,12 @@ func (rsrf *RSRField) RegexpMatched() bool { // Investigate whether we had a reg } func (rsrf *RSRField) FilterPasses(value string) bool { - fmt.Printf("RSRField: %s, filterPasses value: <%q>\n", ToJSON(rsrf), value) if len(rsrf.filters) == 0 { // No filters return true } parsedVal := rsrf.ParseValue(value) - fmt.Printf("parsedVal: %s\n", parsedVal) filterPasses := false - fmt.Printf("having filters: %s, len(filters): %d\n", ToJSON(rsrf.filters), len(rsrf.filters)) for _, fltr := range rsrf.filters { - fmt.Printf("Checking filter: %s") if fltr.Pass(parsedVal) { filterPasses = true } @@ -194,7 +190,6 @@ type RSRFilter struct { } func (rsrFltr *RSRFilter) Pass(val string) bool { - fmt.Printf("Filter with rule: %s, parsing val: %q\n", rsrFltr.filterRule, val) if rsrFltr.filterRule == "" { return !rsrFltr.negative }