partial step towards implementing regexec (StateSet added): compiles with warnings, functionality not tested at all