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