Added pattern validation.