title: Regex to match an IP address
body: <p>I am newbie with regex and  I want to use <code>preg_match</code> function to find if a string is an IP address. </p>
  
  <p>For example, </p>
  
  <pre><code>$string = "10.0.0.1";
  preg_match($regex, $string);
  </code></pre>
  
  <p>should return true. So, what <code>$regex</code> should be? </p>