[SlugBug] regular expression for ip address matching

Mr. Adam ALLEN. allena28 at mellon-collie.net
Fri Nov 7 19:49:40 GMT 2003


Anyone good with regular expressions, at the end of work today and a bit
of Coffee I couldn't get the right regular expression sorted.

I need to make a decision based on a certain ip.. as in
 
 match any ip address except 100.201.30.0

I can't do if($_ !~ /100\.201\.30\..*/) since the parser is really
limited. (By the way it's not perl)

The closest I got was:

 permit [^1][^0][^0]\.[^2][^0][^1]\.[^3][^0].*

But that would deny 
  199.201.30

And [^(100)]\.[^(200)] was been interpreted as not 1 or 0 or either of (
or ).

Anyone else got the right approach to this one.
-- 
Regards,
Adam Allen.

PGP: http://pgp.mit.edu:11371/pks/lookup?search=mellon-collie.net&op=index
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.email-lists.org/pipermail/slugbug/attachments/20031107/4f1982cb/attachment.bin


More information about the SlugBug mailing list