Regex for 4 to 8 digits

Matches a number between 4 and 8 digits long.

^\d{4,8}$

Proof it works

4/4 sample tests passed · compiles: true

SampleShould matchResult
3074 yes pass
30741852 yes pass
307 no pass
307418529 no pass

Try your own input

Related patterns