From ff60bc338fb5a53be1bd45a472ce2206ffeb3dc6 Mon Sep 17 00:00:00 2001 From: funkydude Date: Sun, 12 Feb 2017 16:55:11 +0000 Subject: [PATCH] urlcopy: Fix URL matching when the URL started with a protocol. Please report any regressions (missed URLs) from this change. --- urlcopy.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/urlcopy.lua b/urlcopy.lua index d4b7a51..98301f6 100644 --- a/urlcopy.lua +++ b/urlcopy.lua @@ -19,22 +19,22 @@ BCM.modules[#BCM.modules+1] = function() -- As of the introduction of the S.E.L.F.I.E camera we now require at least 2 valid letters e.g. yo.hi local filterFunc = function(_, _, msg, ...) local newMsg, found = gsub(msg, - "( )([^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+/[^ \"%^`{}%[%]\\|<>]+)", + "( )([^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+/[^ \"%^`{}%[%]\\|<>]+)", "%1|cffffffff|Hbcmurl~%2|h[%2]|h|r" ) if found > 0 then return false, newMsg, ... end newMsg, found = gsub(msg, - "^[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+/[^ \"%^`{}%[%]\\|<>]+", + "^[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+/[^ \"%^`{}%[%]\\|<>]+", "|cffffffff|Hbcmurl~%1|h[%1]|h|r" ) if found > 0 then return false, newMsg, ... end newMsg, found = gsub(msg, - "( )([^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+)", + "( )([^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+)", "%1|cffffffff|Hbcmurl~%2|h[%2]|h|r" ) if found > 0 then return false, newMsg, ... end newMsg, found = gsub(msg, - "^[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~%d]+", + "^[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]%.[^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d][^ %%'%-=%./,\"%^`{}%[%]\\|<>%(%)%*~:%d]+", "|cffffffff|Hbcmurl~%1|h[%1]|h|r" ) if found > 0 then return false, newMsg, ... end