RE: Regular expression to test for numeric values

2004-04-02 Thread Beckett Richard-qswi266
> So I get: > > /^-?(?:\d+\.?\d*|\.\d+)$/ I'm being thrown by the ?: What's that all about? R. ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Regular expression to test for numeric values

2004-04-01 Thread Dial Joe
" By Tom Christiansen, Nathan Torkington 2nd Edition August 2003 ISBN: 0-596-00313-7 964 pages, $49.95 US, $77.95 CA, £35.50 UK -Original Message- From: Motter, Jeffrey D [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 1:40 PM To: Perl-Win32-Users Subject: Regular expression to t

RE: Regular expression to test for numeric values

2004-04-01 Thread Peter Eisengrein
Title: RE: Regular expression to test for numeric values use Scalar::Util; if (Scalar::Util::looks_like_number $num) {     print "Yes, $num is a number\n"; } else {     print "no.\n"; } ... found it with perldoc -q number, which also showed a number of rege

RE: Regular expression to test for numeric values

2004-04-01 Thread Joseph Discenza
Gerber, Christopher J wrote, on Thursday, April 01, 2004 2:12 PM : -Original Message- : My guess is that I need a regex that will match on any character that is: : not 0-9 : or : more than one "." : or : more than one "-" : or if "-" is not the fir

RE: Regular expression to test for numeric values

2004-04-01 Thread Gerber, Christopher J
-Original Message- My guess is that I need a regex that will match on any character that is: not 0-9 or more than one "." or more than one "-" or if "-" is not the first character of the string Any ideas? Is it possible to do without usi

RE: Regular expression to test for numeric values

2004-04-01 Thread Peter Guzis
-Users Subject: Regular expression to test for numeric values I've read the FAQ's on this, but they don't seem to answer the question. I have a variable that could contain any value( alpha, alpha-numeric, or numeric). If the value is NOT numeric, I need to change the variables'

Regular expression to test for numeric values

2004-04-01 Thread Motter, Jeffrey D
I've read the FAQ's on this, but they don't seem to answer the question. I have a variable that could contain any value( alpha, alpha-numeric, or numeric). If the value is NOT numeric, I need to change the variables' value to "0"( as in zero ). Examples: $txtype="2.314"; # is numeric, so keep t