First of all, you should check that the addresses you want to match are valid. This has already been discussed recently in Matching an IP address. It's a bit more specific to check if one of your file entries is valid because it depends on the format you've chosen. For example, are 3 dots always needed? How many * signs are allowed, and where? Would *.*.*.255 be valid? And so on. However, with pattern matching and split you should be able to sort it out. Watch out if you split using . as a separator! It's a special character so you'll need to escape it.
Then it's a matter of a simple (internal) transformation on your file's contents: 128.10.*.* is almost a regular expression. All you need to do is escaping each dot with a backslash and substituting each * with [0-9]{1,3}
Then you should be able to match directly your transformed file entries with your addresses.
-- TMTOWTDI
In reply to Re: IP Verification Check System
by trantor
in thread IP Verification Check System
by LostS
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |