Added regex validator to the rule class.