Explorar o código

Fix username regex

Zed %!s(int64=7) %!d(string=hai) anos
pai
achega
a7249080db
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/formatters.nim

+ 1 - 1
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" ?…"