http://www.perlmonks.org?node_id=1084832


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

To test if a variable contains a repeat sequence of some letter, any one letter:

if ($myvar =~ /^([[:alpha:]])\1*\z/) { ... }