<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Comments on snippet: 'Verify if an IPv4 IP address is valid'</title>
    <description>Snipplr comments feed</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Mon, 13 Apr 2026 01:35:15 +0000</lastBuildDate>
    <item>
      <title>numberwhun said on 16/Jul/2007</title>
      <link>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</link>
      <description>&lt;p&gt;&lt;p&gt;Thanks for the missing '$'.  I will be sure and add it.  Glad that it helped you with your project as well!&lt;/p&gt;
&lt;/p&gt;</description>
      <pubDate>Mon, 16 Jul 2007 08:43:58 UTC</pubDate>
      <guid>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</guid>
    </item>
    <item>
      <title>numberwhun said on 12/Nov/2010</title>
      <link>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</link>
      <description>&lt;p&gt;@veljkopopovic Your absolutely right, there is a module for that.  But, at the time that I put this together I was learning and posted what was working for me.  I preferred to re-invent the wheel, that's why I wrote this.&#13;
&#13;
@j0sh097 Good point on the $.  I never actually came back to this and corrected it.  I did notice that fact and corrected it in my local scripts where I used it, but never updated it here. Thanks for pointing that out.&#13;
&#13;
@dhineshkumar I would still chomp $ARGV as a "just in case", but that's me.  :)  Thanks!&lt;/p&gt;</description>
      <pubDate>Fri, 12 Nov 2010 11:04:03 UTC</pubDate>
      <guid>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</guid>
    </item>
    <item>
      <title>numberwhun said on 12/Nov/2010</title>
      <link>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</link>
      <description>&lt;p&gt;@j0sh097 Just wanted to note that the version I used in the code actually catches the 1.1.1.1e and doesn't let it pass.  The one you mentioned does let it slip, so I am glad I used the one I did.  :)&#13;
&#13;
use warnings;&#13;
&#13;
&#13;
print("What is the IP Address you would like to validate: ");&#13;
my $ipaddr = ;&#13;
chomp($ipaddr);&#13;
&#13;
&#13;
if( $ipaddr =~ m/^(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)\.(\d\d?\d?)$/ )&#13;
{&#13;
    print("IP Address $ipaddr  --&gt;  VALID FORMAT! \n");&#13;
    &#13;
    if($1&lt;/p&gt;</description>
      <pubDate>Fri, 12 Nov 2010 11:27:50 UTC</pubDate>
      <guid>https://snipplr.com/view/2801/verify-if-an-ipv4-ip-address-is-valid</guid>
    </item>
  </channel>
</rss>
