Use a regex to validate the types for more flexibility