first step towards implementing regexec
bug with a*c fixed