I know that you can't repeat match groups in Lua. For example, if I wanted to match the two successive "45"
's, I can't do:
print(string.find("some 4545 text", "(%d%d)+"))
which will print nil
(no match found).
However, since find(...)
doesn't report an error (for the invalid patterns "%"
and "(%d"
errors are produced), it leads me to believe the pattern "(%d%d)+"
is a valid one.
If "(%d%d)+"
is a valid pattern, what does it match? And if it isn't, is there a particular reason no error is produced?