Generalize YouTube regex

This commit is contained in:
Zed 2019-12-06 04:37:38 +01:00
parent 1f2a725f4d
commit dc56e3ebe2

View file

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