http://www.perlmonks.org?node_id=395389


in reply to Match a Range of IP's

your [1-99] really means match only one character [1-9] (you can't do ranges on two-digit numbers). You need this:
while (<DATA>){ print "$_\n" if m/^192\.168\.[1-9][0-9]?\.\d+$/; }