浏览代码

Fix username regex

Zed 7 年之前
父节点
当前提交
a7249080db
共有 1 个文件被更改,包括 1 次插入1 次删除
  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" ?…"