in reply to Check if a variable contains only one letter?
$myvar =~ /^X+$/;
Update: Be careful as "XXXX\n" also matches, so you might need to chomp first.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Check if a variable contains only one letter?
by tobyink (Canon) on May 02, 2014 at 22:59 UTC | |
|
Re^2: Check if a variable contains only one letter?
by DrHyde (Prior) on May 06, 2014 at 10:38 UTC |