Of course, with 5.9.2, there is a much nicer way to construct an efficient regular expression to match the numbers from 0 to 255 without leading zeroes:
use strict; my $zero_to_255 = join "|", 0..255; $zero_to_255 = qr(^(?:$zero_to_255)$); print $zero_to_255,"\n"; for (-2,-1, 0..259) { print "$_\n" unless /$zero_to_255/; };
In reply to Re: Regexp for range of numbers
by Corion
in thread Regexp for range of numbers
by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |