From 6a45fb0fc6b1d975d3a90eed21d676e64bdf13ae Mon Sep 17 00:00:00 2001 From: DanB Date: Fri, 20 Jul 2018 19:39:12 +0200 Subject: [PATCH] RSRParser.RegexpMatched method --- utils/rsrparser.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/utils/rsrparser.go b/utils/rsrparser.go index 1b3d466ec..c1c93104d 100644 --- a/utils/rsrparser.go +++ b/utils/rsrparser.go @@ -119,6 +119,16 @@ func (prsr *RSRParser) Compile() (err error) { return } +// RegexpMatched will investigate whether we had at least one regexp match through the rules +func (prsr *RSRParser) RegexpMatched() bool { + for _, rsrule := range prsr.rsrRules { + if rsrule.Matched { + return true + } + } + return false +} + func NewRSRParsers(parsersRules string) (prsrs RSRParsers, err error) { if parsersRules == "" { return