Improve youtube/twitter regex

This commit is contained in:
Zed 2019-09-14 08:56:46 +02:00
parent 96b7a6fa51
commit 4ae5d4fda3

View file

@ -11,8 +11,8 @@ const
usernameRegex = re"(^|[^A-z0-9_?])@([A-z0-9_]+)" usernameRegex = re"(^|[^A-z0-9_?])@([A-z0-9_]+)"
picRegex = re"pic.twitter.com/[^ ]+" picRegex = re"pic.twitter.com/[^ ]+"
ellipsisRegex = re" ?…" ellipsisRegex = re" ?…"
ytRegex = re"(www.)?youtu(be.com|.be)" ytRegex = re"(www.|m.)?youtu(be.com|.be)"
twRegex = re"(www.)?twitter.com" twRegex = re"(www.|mobile.)?twitter.com"
nbsp = $Rune(0x000A0) nbsp = $Rune(0x000A0)
proc stripText*(text: string): string = proc stripText*(text: string): string =