Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: character test functions

by ioannis (Vicar)
on Nov 03, 2005 at 07:54 UTC ( #505250=note: print w/ replies, xml ) Need Help??


in reply to character test functions

Here is one way, for non-Unicode strings:

my $alpha = 'J'; my $num = '3'; $alpha =~ /^ [[:alpha:]] $/x and print 'correct'; $alpha !~ /^ [[:digit:]] $/x and print 'correct'; $num =~ /^ [[:digit:]] $/x and print 'correct'; $num !~ /^ [[:alpha:]] $/x and print 'correct';


Comment on Re: character test functions
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-12-26 07:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (168 votes), past polls