in reply to regexp golf - homework

It doesn't really answer the question, but if you could use (??{}), this would do it:
/^((??{'[^\D'.join('',@c,push @c,$1).']'}))*$/