don't apply pattern validation unless the value is present