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/) { ... }
|
---|
In Section
Seekers of Perl Wisdom
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/) { ... }
|
---|