in reply to Re: need idiom - compare a number to a string
in thread need idiom - compare a number to a string

Your regex only catches positive integers, which may be okay -- but it's certainly not all valid numbers. Consider negative integers, rationals, and numbers in scientific notation, for exammple.

  • Comment on Re^2: need idiom - compare a number to a string

Replies are listed 'Best First'.
Re^3: need idiom - compare a number to a string
by ikegami (Patriarch) on Mar 18, 2006 at 00:08 UTC

    It don't think we have to catch those (well, maybe negatives). It sounds like the OP is talking error codes or something similar, which wouldn't be floating point numbers.