I want to replace any word, character, digit or symbol (except ; , .
) followed by the string "some-word\"
in Lua. More like a '*' option in regex. Is there any thing similar to '*' in Lua?
Example:
some-word\\test
-> some-word\\###
some-word\\b*ax#@$6;
-> some-word\\###;
some-word\\?foo,>
-> some-word\\###,
The code I'm using:
d = "some-word"
p = (tostring(d).."\\[.%c%w%p^%;^%,^%.]+")
c = "###"
s = "testing some-word\\test-2 later some-word\\&^*; some-word\\set_34$ "
print(p)
res = (string.gsub(s,p,c)) print(res)