I've glanced at the wiki page for a way to do this. Now I know you'd use the operator "%d+" in the "string.match" function, but how would you check for a certain number of digits instead of all the digits?
COMMUNITY QUESTION
matching a certain # of digits within a string?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
You can use multiple of the same character class (e.g. 3 digits would be "%d%d%d"), however I do not know of a shortcut
Couldn't you use string.sub? For example, X = "Happy" print(string.sub(x,1,1)) will print the first letter. I'm not quite sure what you were asking though so I probably didn't help xD Good luck though!
Be more specific. What is the exact problem you want to solve? Give several examples of input and output showing both failure and success.
^^^ Yes. I am also confused on what your attempting to do.
To be a little more specifc, there aren't any other --QUANTIFIERS-- that specify a certain # of that specific class (e.x. "%d" specifies only one digit, but instead of doing "%d+", how could you specifiy a certain # of those digits?)