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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -