lua - Remove all chars from a string except "a","b","c","d" -


i have string want replace chars , digits "", except chars a,b,c, d.

instead of having write multiple lines of long code in example below, there other way write more efficient?

mystring:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$%,]", "") --special chars ... --same chars ... --same digits 

use caret symbol ^ is, [^abcd]

caret symbol negates set.

e.g., can read more here.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -