in reply to Range of numbers

if the numbers have same number of digits this could work
#check for 257 theough 313 @aon = ("100","134","259","290","310","314","330"); foreach $n (@aon){ print "$n\n" if ($n =~ /[2-3][1|5-9][0-3|7-9]/); }

Enjoy!
Dageek

Replies are listed 'Best First'.
Re^2: Range of numbers
by jvector (Friar) on Oct 10, 2008 at 17:11 UTC
    Fortuitous test set...
    #check for 257 theough 313 DB<1> @aon = ("100","134","259","290","310","314","330"); DB<2> foreach $n (@aon){print "$n\n" if ($n =~ /[2-3][1|5-9][0-3|7-9]/ +)}; 259 290 310 DB<3> push @aon,"217" # should fail DB<4> print join " ",@aon 100 134 259 290 310 314 330 217 DB<5> foreach $n (@aon){print "$n\n" if ($n =~ /[2-3][1|5-9][0-3|7-9]/ +)}; 259 290 310 217 DB<6>
    This signature will be ready by Christmas