Or if you don't know what the letter is ...
if($myvar =~ /^([A-Za-z])\1*$/) { ... }
That is, match the beginning of the string, then any letter, then any more of that same letter, then the end of the string. Adapt as appropriate for Unicode abominations.
In reply to Re^2: Check if a variable contains only one letter?
by DrHyde
in thread Check if a variable contains only one letter?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |