in reply to Regexp for range of numbers

I'm sure you have your reasons for wanting to do this with a regular expression , but surely the smart way to do it would be:

$number >= 0 and $number <= 255
numeric comparison is going to be faster as that is something that computers can do natively.

/J\

Replies are listed 'Best First'.
Re^2: Regexp for range of numbers
by loris (Hermit) on Apr 05, 2005 at 09:18 UTC

    Thanks for the reply. Actually I have other people's reasons for having to do this with a regexp. The regexp is an attribute in an XML file, which is at some point read by a Perl script.

    loris