in reply to Match a Range of IP's

Hello

You are using a character class in your match.
[1-99] means a "1" to "9" and excatly one of it.

To select only one or two digit number use somethin like
print "$_\n" if /192\.168\.\d\d?\.\d+/g
si_lence Update: bpphillips is right with his answer (shame on me!), so I changed the description.
At least the regex was ok ;-)

Replies are listed 'Best First'.
Re^2: Match a Range of IP's
by bpphillips (Friar) on Sep 30, 2004 at 16:22 UTC
    actually, within a character class, a "-" character indicates a range unless it's at the beginning or the end of the character class