
August 13th, 2012, 07:49 PM
|
 |
Banned ;)
|
|
Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
|
|
Matching IP addresses with regexs is a very bad idea and is best left to masochists. There are some good reasons to use regular expressions, but this isn't one of them.
Best thing to do would be to split the IP address into four octets using . as the delimiter. Then simply convert the last octet to int and check if it is within the range you expect.
See this discussion on Raymond Chen's blog for details.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
|