Regex for string of exactly 4 characters
Matches any string that is exactly 4 character(s) long.
^.{4}$
Proof it works
| Sample | Should match | Result |
|---|---|---|
chmr |
yes | pass |
chmrw |
no | pass |
chm |
no | pass |
Matches any string that is exactly 4 character(s) long.
^.{4}$
| Sample | Should match | Result |
|---|---|---|
chmr |
yes | pass |
chmrw |
no | pass |
chm |
no | pass |