Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Check if a variable contains only one letter?

by oiskuu (Friar)
on May 02, 2014 at 18:10 UTC ( #1084832=note: print w/ replies, xml ) Need Help??


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/) { ... }


Comment on Re: Check if a variable contains only one letter?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1084832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2015-05-27 21:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (547 votes), past polls