Finding numbers ONLY in a variable

2002-02-20 Thread Daniel Falkenberg
hi again all, Sorry to keep approaching you with my regex problems, but I really havn't had time to read up on them yet. If I have a variable... $var = "dfasdf"; 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 :)" if ( $

Re: Finding numbers ONLY in a variable

2002-02-20 Thread Jeff 'japhy' Pinyan
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

RE: Finding numbers ONLY in a variable

2002-02-20 Thread Timothy Johnson
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 number

Re: Finding numbers ONLY in a variable

2002-02-23 Thread Johannes Franken
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