Skip to content

Commit

Permalink
Fix broken regexp matcher.
Browse files Browse the repository at this point in the history
regexp.Compile() accepts regexp without separator, the code must remove
leading and trailing slashes before sending to matcher.
  • Loading branch information
iwat committed May 11, 2017
1 parent 6071cf0 commit 5f3b46f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5f3b46f

Please sign in to comment.