# File formvalidator.rb, line 856 def match_ip_address(val) regexp = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ match = regexp.match(val) error = false if match 1.upto(4) do |i| error = true unless (match[i].to_i >= 0 && match[i].to_i <= 255) end else error = true end error ? nil : match[0] end