Regex for string of exactly 4 characters

Matches any string that is exactly 4 character(s) long.

^.{4}$

Proof it works

3/3 sample tests passed · compiles: true

SampleShould matchResult
chmr yes pass
chmrw no pass
chm no pass

Try your own input

Related patterns