From 131ee8d87c641f1d6a80f3be5c11205e158e8b5d Mon Sep 17 00:00:00 2001 From: Zoe Martin Date: Fri, 25 Jun 2021 15:14:30 +0200 Subject: [PATCH] fix: improved url regex --- PluralKit.Bot/Proxy/ProxyService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Proxy/ProxyService.cs b/PluralKit.Bot/Proxy/ProxyService.cs index a70322aa..933b46cf 100644 --- a/PluralKit.Bot/Proxy/ProxyService.cs +++ b/PluralKit.Bot/Proxy/ProxyService.cs @@ -186,7 +186,7 @@ namespace PluralKit.Bot } var endsWithUrl = Regex.IsMatch(msg, - @"(http|https)?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$"); + @"(http|https)(:\/\/)?(www\.)?([-a-zA-Z0-9@:%._\+~#=]{1,256})?\.?([a-zA-Z0-9()]{1,6})?\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$"); if (endsWithUrl) { var urlTail = repliedTo.Content.Substring(100).Split(" ")[0];