creation of Regexp enum

and related refactoring