Ok, I have some garbled up text strings and I want to extract the lower-case characters, upper-case characters and numerical values from the string to three sub-strings and later use them for my purpose. I currently have a code like this:
sInput = "AWSEDRGY VGIYCfry2345ewScfvg gyiFvyGXSCyuI^RSfv GYD&K^dfyUODvl234SDv8p7ogYHS"
local sLower, sUpper, sNumbers = "", "", ""
sInput:gsub("%l", function(s) sLower=sLower..s end)
sInput:gsub("%u", function(s) sUpper=sUpper..s end)
sInput:gsub("%d", function(s) sNumbers=sNumbers..tostring(s) end)
print( sLower, sUpper, sNumbers )
and this is working fine. I am just not sure on using these three separate extractions for nearly 30,000 lines of such garbled text. Is there more efficient way? Or my way is the best possible solution?
Try using complement classes: