Add pattern validation.