On Thu, Feb 21, 2002 at 02:22:48PM +1030, Daniel Falkenberg wrote:
> Is it possible to get a regex to say ... "hang on I only want numerals
> in my variable.
> if ( $var =! Digits ) {
Your regex is: /^\d+$/ , which means:
- any numeral (\d)
- at least one time (+)
- but nothing else in that lin
Try using these metacharacters when testing for types:
\d digits(0-9)
\s whitespace(' ',\t,etc.)
\w 'word' characters (a-zA-Z_,etc.)
-Original Message-
From: Daniel Falkenberg
To: [EMAIL PROTECTED]
Sent: 2/20/02 7:52 PM
Subject: Finding numbers ONLY in a variable
h
On Feb 21, Daniel Falkenberg said:
>Sorry to keep approaching you with my regex problems, but I really
>havn't had time to read up on them yet.
>
>Is it possible to get a regex to say ... "hang on I only want numerals
>in my variable. I am now going to print an error :)"
You're not the only one