regex pater for only 4 or 6 digits code example Example: regex pater for only 4 or 6 digits ^([0-9]{4}|[0-9]{6})$