in reply to Re: Guess That Number
in thread Guess That Number

/[^0-9]/

more succintly written as /\D/.

Replies are listed 'Best First'.
Re^3: Guess That Number
by JavaFan (Canon) on Jul 10, 2009 at 09:37 UTC
    No actually. /[^0-9]/ is correct, where /\D/ isn't. Your perl is from the previous century if /\D/ equals /[^0-9]/.

      s/succinctly/correctly/, then.

        No. /\D/ is wrong. It will allow entries which Perl cannot convert to integers in a meaningful way. There are more that two hundred characters which aren't matched by /\D/, but for which Perl cannot do arithmetic.