dan wrote:
> Hey again,
> 
> I want to be able to check if a string contains only a number, no
> letters, etc. I have this procedure:
> 
> if ($numexs =~ /[0-9]/{
>     # do something
> }
> 
> which doesn't do what I want it to do, I want it to do more or less
> this: if ($numexs contains anything other than numbers) {
>     # do something
> }
> 
> All help much appreciated.
> 
> Dan

if ( $numexs =~ /^[-+]{0,1}\d+\.{0,1}\d{0,}/ ) {
   # a number of format: nnn, -nnn, +nnn, -nn.nnn, etc)
 }else {
   # not a number
 }

Wags ;)


**********************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
****************************************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to