From 51ab2e8531f32018c995bf2f4ca3795dbf54e6f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Cuadrado=20Juan?= Date: Thu, 21 Feb 2019 15:23:11 +0100 Subject: [PATCH] Fine tune the mention regex with unicode classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now it matches [[urza's rage]], [[Übermäßiges Wachstum]], and the like. --- src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go b/src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go index d5cf346..557e22b 100644 --- a/src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go +++ b/src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go @@ -20,7 +20,7 @@ import ( const ServiceType = "mtgcard" // Matches [[ then word separated with spaces then ]]. E.g "[[card Name]] -var cardRegex = regexp.MustCompile(`\[\[\w+(\s*\w+)*\]\]`) +var cardRegex = regexp.MustCompile(`\[\[[\p{L}|\p{Po}+|\s*]+\]\]`) type scryfallSearch struct { Name string `json:"name"`