Regex Pater por solo 4 o 6 dígitos

^([0-9]{4}|[0-9]{6})$
Jealous Jay