我有一个字符串,我想,以取代所有的字符和数字用"",除了字符a,b,c,d.
""
a
b
c
d
而不是像下面的例子中那样编写多行长代码,还有其他一些方法可以更有效地编写它吗?
myString:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$%,]", "") --special chars ... --same for chars ... --same for digits
lua gsub lua-patterns
gsub ×1
lua ×1
lua-patterns ×1