need an outstanding IP regular expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuananh87vn
    New Member
    • Sep 2007
    • 63

    need an outstanding IP regular expression

    Code:
    \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
    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
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Have a look at Data::Validate: :IP at CPAN.

    --Kevin

    Comment

    Working...