Skip to content

Commit

Permalink
urlcopy: Fix URL matching when the URL started with a protocol. Pleas…
Browse files Browse the repository at this point in the history
…e report any regressions (missed URLs) from this change.
  • Loading branch information
funkydude committed Feb 12, 2017
1 parent c65d370 commit ff60bc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions urlcopy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ff60bc3

Please sign in to comment.