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?

5 comments

0

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

0

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!

3

Be more specific. What is the exact problem you want to solve? Give several examples of input and output showing both failure and success.

0

^^^ Yes. I am also confused on what your attempting to do.

0

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?)