is valid if the URL is valid ruby code example Example: rails check if a URL is valid require 'uri' url =~ URI::regexp # => 0 if it match, nil if not