mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update string.match
This commit is contained in:
@@ -109,7 +109,15 @@ function string.match(str, pattern, index)
|
||||
index = index ~= "" and tonumber(index) or nil
|
||||
end
|
||||
|
||||
return gfind(index and sub(str, index) or str, gsub(pattern, "%^", ""))() or ""
|
||||
local i1, i2, match, match2 = find(str, pattern, index)
|
||||
|
||||
if not match and i2 and i2 >= i1 then
|
||||
return sub(str, i1, i2)
|
||||
elseif match2 then
|
||||
return select(3, find(str, pattern, index))
|
||||
end
|
||||
|
||||
return match
|
||||
end
|
||||
strmatch = string.match
|
||||
|
||||
|
||||
Reference in New Issue
Block a user