From a7249080db07f5c276091f5844ffc844675e9f5e Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 3 Jul 2019 11:46:44 +0200 Subject: [PATCH] Fix username regex --- src/formatters.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/formatters.nim b/src/formatters.nim index 22a88a4..5630e75 100644 --- a/src/formatters.nim +++ b/src/formatters.nim @@ -8,7 +8,7 @@ from unicode import Rune, `$` const urlRegex = re"((https?|ftp)://(-\.)?([^\s/?\.#]+\.?)+([/\?][^\s\)]*)?)" emailRegex = re"([a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+)" - usernameRegex = re"(^|[\s\.,>])@([A-z0-9_]+)" + usernameRegex = re"(^|[^A-z])@([A-z0-9_]+)" picRegex = re"pic.twitter.com/[^ ]+" cardRegex = re"(https?://)?cards.twitter.com/[^ ]+" ellipsisRegex = re" ?…"