Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: character test functions

by ioannis (Monsignor)
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';

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://505250]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-11-21 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?