sanitize_lua

🔗NAME

sanitize_lua

🔗SYNOPSIS

escape lua ‘magic’ characters from a pattern string

🔗USAGE

local ds = require "lib/dtutils.string"
local result = ds.sanitize_lua(str)

str - string - the string that needs to be made safe

🔗DESCRIPTION

sanitize_lua escapes lua ‘magic’ characters so that a string may be used in lua string/patten matching.

🔗RETURN VALUE

result - string - a lua pattern safe string