now Lua don't support ?,*,+,- on a so-called sub-pattern, but from the
source, to add this support is easy: we can add a special %r (means
recurse) modifier, so as:
("catcatcat"):match "%r(cat)+"
returns
catcatcat
I do a recursion.
function checkformat(what)
-- Lua cannot handle repeated multibyte patterns
-- i.e. [Ab]+ does not match AbAbAb...
-- this situation is handled by a recursive function