(uncompilable state) partial step towards implementing regexec()