Skip to content

Commit

Permalink
Fix URL matching for a URL with a number or a dash. Please report any…
Browse files Browse the repository at this point in the history
… regressions (missed URLs) from this change.
  • Loading branch information
funkydude committed Feb 13, 2017
1 parent ff60bc3 commit 7f702ad
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]+/[^ \"%^`{}%[%]\\|<>]+)",
"%1|cffffffff|Hbcmurl~%2|h[%2]|h|r"
)
if found > 0 then return false, newMsg, ... end
newMsg, found = gsub(msg,
"^[^ %%'%-=%.,\"%^`{}%[%]\\|<>%(%)%*~%d]*%.?[^ %%'%-=%.,\"%^`{}%[%]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\"%^`{}%[%]\\|<>%(%)%*!%?_%+#&;~:%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]+",
"|cffffffff|Hbcmurl~%1|h[%1]|h|r"
)
if found > 0 then return false, newMsg, ... end
Expand Down

0 comments on commit 7f702ad

Please sign in to comment.