added getpattern, fixed getenumby