I'm looking for a way search in a string for a very specific set of characters: "(),:;<>@[\]
specialChar = str:find("[\"][%(][%)][,][:][;][<][>][@][%[][%]][\\]")
I'm thinking that there will be no pattern to satisfy my need because of the Limitations of Lua patterns.
I have read the Lua Manual pattern matching section pretty thoroughly but still can't seem to figure it out.
Does anyone know a way I can identify if a given string contains any of these characters?
Note, I do not need to know anything about which character or where in the string it is, if that helps.
[set]: represents the class which is the union of all characters in set. (...)". In other words your pattern would match the very sequence you have specified. If you want any of them, put them together in[]as in Wiktor's answer. Also - don't assume that there is no solution straight away. Having good mindset is often helpful in finding answers. Please note that it works exactly the same way in regex. - Green