On Wed, 14 Feb 2007 12:16:49 -0500, Wally Kolcz wrote:
> I would like to show one set of links to our users who
are inside our
> network and a different set to those outside our
network. We have an IP
> range from 192.168.0.0 - 192.168.255.255. I am capturing
the IP address of
> the visitor using CGI.REMOTE_ADDR.
>
> How can I compare the captured IP address to evaluate if
it is GTE
> 192.168.0.0 AND LTE 192.168.255.255?
if (reFind("192\.168\.[0-9]{1,3}\.[0-9]{1,3}",
CGI.REMOTE_ADDR)
That regex will not an IP address, per-se, as it'll match
stuff like
192.168.999.999, but the web server will only pass valid IP
addies, so that
part of the validation is already done.
This'll only work for complete 0-255 0-255 ranges on the last
two bytes,
but that meets your stated requirement.
--
Adam