From 178883cfb1283b169462277cc2c37d5364b3ed48 Mon Sep 17 00:00:00 2001 From: "Hemming, Andrew" Date: Tue, 5 Mar 2019 11:11:32 +0000 Subject: [PATCH] Fix re --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 3845d99..aa70323 100644 --- a/server.go +++ b/server.go @@ -120,7 +120,7 @@ func queryToSQL(q *prompb.Query) (string, error) { selectors = append(selectors, fmt.Sprintf("(%s != %s)", escapeLabelName(m.Name), escapeLabelValue(m.Value))) } case prompb.LabelMatcher_RE: - re := "^(?:" + m.Value + ")$" + re := "(" + m.Value + ")" matchesEmpty, err := regexp.MatchString(re, "") if err != nil { return "", err @@ -132,7 +132,7 @@ func queryToSQL(q *prompb.Query) (string, error) { selectors = append(selectors, fmt.Sprintf("(%s ~ %s)", escapeLabelName(m.Name), escapeLabelValue(re))) } case prompb.LabelMatcher_NRE: - re := "^(?:" + m.Value + ")$" + re := "(" + m.Value + ")" matchesEmpty, err := regexp.MatchString(re, "") if err != nil { return "", err