By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,542 Members | 1,434 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,542 IT Pros & Developers. It's quick & easy.

need an outstanding IP regular expression

P: 63
Expand|Select|Wrap|Line Numbers
  1. \b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
  2.  
This ip validator matches most of IP addresses I tried, however it also considers 09.09.15.59 as an IP inside 20si10298798agb.38.2008.09.09.15.59.18;

can anybody help me find way to match most ips but ignore the above stupid non-ip string
Sep 17 '08 #1
Share this Question
Share on Google+
1 Reply


eWish
Expert 100+
P: 971
Have a look at Data::Validate::IP at CPAN.

--Kevin
Sep 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.