Remove illegal characters from string?

Hi,

Does anybody know how to remove illegal characters from a string?
The find function in Lua only seems to find a exact string.

I have a list of illegal chars, for example:

invalidList = ",<.>?;:'@#~]}[{=+)(*&amp;^%$£!`¬| -_"<br><br>text = "Any text as long as theres no illegal character, like ?"<br><br>

I looked into the documentation string.find, string.gsub but can’t find a solution.
[import]uid: 50459 topic_id: 17270 reply_id: 317270[/import] </.>


[EDITED]
… [import]uid: 89165 topic_id: 17270 reply_id: 65294[/import]

Have you tried running string.gsub on text for each character in the invalidList?

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 17270 reply_id: 65307[/import]

Yeah, thought about that, i was hoping there would be an easier way :slight_smile: [import]uid: 50459 topic_id: 17270 reply_id: 65433[/import]