Regex for 2 letters only
Matches exactly 2 alphabetic letters (no digits).
^[A-Za-z]{2}$
Proof it works
| Sample | Should match | Result |
|---|---|---|
ch |
yes | pass |
ch1 |
no | pass |
chm |
no | pass |
Matches exactly 2 alphabetic letters (no digits).
^[A-Za-z]{2}$
| Sample | Should match | Result |
|---|---|---|
ch |
yes | pass |
ch1 |
no | pass |
chm |
no | pass |