Regexp cleanup

Use matchdata instead of global vars.