on Thu, 27 Feb 2003 13:34:40 GMT, [EMAIL PROTECTED] (Zentara) wrote: > if (/\D/) { print "has nondigits\n" } > if (/^\d+$/) { print "is a whole number\n" } > if (/^-?\d+$/) { print "is an integer\n" } > if (/^[+-]?\d+$/) { print "is a +/- integer\n" } > if (/^-?\d+\.?\d*$/) { print "is a real number\n" } > if (/^-?(?:\d+(?:\.\d*)?|\.\d+)$/) { print "is a decimal number\n" > } if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/) > { print "a C float\n" }
It would be considered polite to indicate that you copied this information verbatim from the Perl FAQ. It would be wiser imho to explain to the OP how to find this in the FAQ himself instead of throwing him just one fish. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]