feat: add ^ and $ to characters handled by regex escape (#1007)
This commit is contained in:
@@ -19,13 +19,14 @@ local filter = vim.tbl_filter
|
|||||||
local files = {}
|
local files = {}
|
||||||
|
|
||||||
local escape_chars = function(string)
|
local escape_chars = function(string)
|
||||||
return string.gsub(string, "[%(|%)|\\|%[|%]|%-|%{%}|%?|%+|%*]", {
|
return string.gsub(string, "[%(|%)|\\|%[|%]|%-|%{%}|%?|%+|%*|%^|%$]", {
|
||||||
["\\"] = "\\\\", ["-"] = "\\-",
|
["\\"] = "\\\\", ["-"] = "\\-",
|
||||||
["("] = "\\(", [")"] = "\\)",
|
["("] = "\\(", [")"] = "\\)",
|
||||||
["["] = "\\[", ["]"] = "\\]",
|
["["] = "\\[", ["]"] = "\\]",
|
||||||
["{"] = "\\{", ["}"] = "\\}",
|
["{"] = "\\{", ["}"] = "\\}",
|
||||||
["?"] = "\\?", ["+"] = "\\+",
|
["?"] = "\\?", ["+"] = "\\+",
|
||||||
["*"] = "\\*",
|
["*"] = "\\*", ["^"] = "\\^",
|
||||||
|
["$"] = "\\$",
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user