Refactor regex validators.