Dru has asked for the wisdom of the Perl Monks concerning the following question:
Monks,
My apologies if this has already been answered. I've searched using Super Search, but I don't think I'm giving it what it wants.
What I thought would turn out to be a fairly easy match, has got me pulling my hair out. As you can see from the below, I'm trying to match any address between 192.168.1.x - 192.168.99.x, but the only three it will match is:
Dru
My apologies if this has already been answered. I've searched using Super Search, but I don't think I'm giving it what it wants.
What I thought would turn out to be a fairly easy match, has got me pulling my hair out. As you can see from the below, I'm trying to match any address between 192.168.1.x - 192.168.99.x, but the only three it will match is:
Even if I change the range to 20-99.192.168.1.50 192.168.6.50 192.168.8.50
Thanks,use warnings; use strict; while (<DATA>){ print "$_\n" if /192\.168\.[1-99]\.\d+/g; } __DATA__ 192.168.1.50 192.168.6.50 192.168.8.50 192.168.28.50 192.168.58.50 192.168.101.50 192.168.201.50
Dru
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Match a Range of IP's
by conrad (Beadle) on Sep 30, 2004 at 16:15 UTC | |
Re: Match a Range of IP's
by bpphillips (Friar) on Sep 30, 2004 at 16:13 UTC | |
Re: Match a Range of IP's
by Zaxo (Archbishop) on Sep 30, 2004 at 16:21 UTC | |
Re: Match a Range of IP's
by DrHyde (Prior) on Sep 30, 2004 at 16:56 UTC | |
Re: Match a Range of IP's
by SpanishInquisition (Pilgrim) on Sep 30, 2004 at 17:26 UTC | |
Re: Match a Range of IP's
by runrig (Abbot) on Sep 30, 2004 at 18:13 UTC | |
Re: Match a Range of IP's
by lhoward (Vicar) on Sep 30, 2004 at 18:22 UTC | |
Re: Match a Range of IP's
by si_lence (Deacon) on Sep 30, 2004 at 16:18 UTC | |
by bpphillips (Friar) on Sep 30, 2004 at 16:22 UTC | |
Re: Match a Range of IP's
by fokat (Deacon) on Sep 30, 2004 at 23:18 UTC | |
by runrig (Abbot) on Sep 30, 2004 at 23:34 UTC | |
Re: Match a Range of IP's
by Dru (Hermit) on Sep 30, 2004 at 18:02 UTC | |
Re: Match a Range of IP's
by TedPride (Priest) on Oct 01, 2004 at 09:42 UTC |
Back to
Seekers of Perl Wisdom