Browse Source

Fine tune the mention regex with unicode classes

Now it matches [[urza's rage]], [[Übermäßiges Wachstum]], and the like.
pull/267/head
Víctor Cuadrado Juan 6 years ago
parent
commit
51ab2e8531
No known key found for this signature in database GPG Key ID: 223F15CA5AAF0E78
  1. 2
      src/github.com/matrix-org/go-neb/services/mtgcard/mtgcard.go

2
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"`

Loading…
Cancel
Save