From 45a091ac6f9ec542fe9de0d122092808ebd13b03 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 25 Jun 2019 16:44:48 -0400 Subject: [PATCH] last char of mention should not include punctuation --- fun.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fun.go b/fun.go index c4191e7..117bf91 100644 --- a/fun.go +++ b/fun.go @@ -135,7 +135,7 @@ type Mention struct { where string } -var re_mentions = regexp.MustCompile(`@[[:alnum:]._-]+@[[:alnum:].-]+`) +var re_mentions = regexp.MustCompile(`@[[:alnum:]._-]+@[[:alnum:].-]*[[:alnum:]]`) var re_urltions = regexp.MustCompile(`@https://\S+`) func grapevine(s string) []string {