title: Perl regular expression to match an IP address
body: <p>I have written this code, but it does not work.
  Can someone point out the issue?</p>
  
  <pre><code>sub match_ip()
  {
    my $ip = "The IP address is 216.108.225.236:60099";
    if($ip =~ /(\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3}\:\d{1-5})/)
    {
        print "$1\n";
    }
  }
  </code></pre>
  
  <p>EDIT:
  I wanted to just extract the IP address, not do any validation.</p>