lazuscripts-utility/db.moon

10 lines
259 B
Plaintext
Raw Normal View History

2018-03-13 09:09:45 +00:00
escape_similar_to = (str) ->
-- matches any of %_\|*+?{}()[]
-- puts a backslash in front of them
str = str\gsub "[%%_\\|%*%+%?{}%(%)%[%]]", "\\%1"
return str -- return on seperate line to avoid returning 2nd value from gsub
{
:escape_similar_to
}