http://qs321.pair.com?node_id=1085158


in reply to Re: Check if a variable contains only one letter?
in thread Check if a variable contains only one letter?

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.