瀏覽代碼

Generalize YouTube regex

Zed 6 年之前
父節點
當前提交
dc56e3ebe2
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/formatters.nim

+ 3 - 3
src/formatters.nim

@@ -1,5 +1,5 @@
-import strutils, strformat, sequtils, times, uri, tables
-import xmltree, htmlparser, htmlgen
+import strutils, strformat, times, uri, tables
+import xmltree, htmlparser
 import regex
 
 import types, utils, query
@@ -7,7 +7,7 @@ import types, utils, query
 from unicode import Rune, `$`
 
 const
-  ytRegex = re"(www.|m.)?youtu(be.com|.be)"
+  ytRegex = re"([A-z.]+\.)?youtu(be.com|.be)"
   twRegex = re"(www.|mobile.)?twitter.com"
   nbsp = $Rune(0x000A0)