From 5f3b46fd0b3c77700a58abc857f5da48d9a2c3b0 Mon Sep 17 00:00:00 2001 From: iwat Date: Thu, 11 May 2017 09:22:57 +0700 Subject: [PATCH] Fix broken regexp matcher. regexp.Compile() accepts regexp without separator, the code must remove leading and trailing slashes before sending to matcher. --- internal/matcher.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/matcher.go b/internal/matcher.go index c194c34..fec3a88 100644 --- a/internal/matcher.go +++ b/internal/matcher.go @@ -35,6 +35,7 @@ type _RegexpMatcher struct { } func newRegexpMatcher(pattern string) (*_RegexpMatcher, error) { + pattern = pattern[1 : len(pattern)-1] p, err := regexp.Compile(pattern) if err != nil { return nil, err