Adding regex support in the Validator class.