title: Regular expression to validate IPv4 address in ruby
body: <p>I want to verify whether a given string is valid IPv4 address or not in ruby.
  I tried as follows but what is does is matches values greater than 255 as well.
  How to limit each block's range from 0-255</p>
  
  <pre><code>str="255.255.255.256"
  if str=~ /\b[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\b/
  puts true
  else
  puts false
  end
  </code></pre>