don't validate pattern if value is empty.