determine whether a field is numeric, alpha or alphanumeric

determine whether a field is numeric, alpha or alphanumeric

Post by shiraz » Sun, 22 May 2005 13:00:35


is their a function or way to determine whether a field, or variable
for that matter, is numeric, alpha or alphanumeric?
thanks in advance
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by anno400 » Sun, 22 May 2005 19:31:25


< XXXX@XXXXX.COM > wrote in comp.lang.perl.misc:

perldoc -q 'is a number' leads to "How do I determine whether a scalar
is a number/whole/integer/float?". Please check the FAQ before posting.

Anno

 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Shira » Mon, 23 May 2005 11:02:09

that finds out if a scaler is a number or not. i want to see if there
is a way to find out if its am alphanumeric, so contains both alphabets
and numbers and maybe punctuation
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Peter Wyz » Mon, 23 May 2005 14:52:08


: that finds out if a scaler is a number or not. i want to see if there
: is a way to find out if its am alphanumeric, so contains both alphabets
: and numbers and maybe punctuation

So take the answer from the FAQ, apply two grams of brain power and call
again if your solution does not give the desired results.

P
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Shira » Mon, 23 May 2005 15:32:32

damn this is a hostile group
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Tad McClel » Mon, 23 May 2005 15:37:37


Yes, there is a way.

Use regular expressions and the match operator.

perldoc perlrequick
perldoc perlretut
perldoc perlre

perldoc -f m
perldoc perlop


If you post your code here, we will help you fix it.


--
Tad McClellan SGML consulting
XXXX@XXXXX.COM Perl programming
Fort Worth, Texas
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Tad McClel » Mon, 23 May 2005 22:12:06


No, this is a group where people are expected to expend a little
of their own effort before asking hundreds of others to spend
effort on their behalf.

We help people fix Perl code, we don't generally write their
Perl code for them.

Take your best shot at solving your problem, and if it doesn't work,
post your broken code here and we will help you fix it.


--
Tad McClellan SGML consulting
XXXX@XXXXX.COM Perl programming
Fort Worth, Texas
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Shira » Tue, 24 May 2005 03:49:49

i appreciate you pointing me in the right direction....
 
 
 

determine whether a field is numeric, alpha or alphanumeric

Post by Tad McClel » Tue, 24 May 2005 06:01:05


Who pointed you in the right direction?

Please quote some context in followups like everybody else does.


--
Tad McClellan SGML consulting
XXXX@XXXXX.COM Perl programming
Fort Worth, Texas