title: Validates url format in Ruby on Rails
body: <p>I'd like ask if there's a way to validate a string as an url or email at the same time?</p>
  
  <p>for example:</p>
  
  <pre><code>validates_format_of :string, :with =&gt; [url_regex, email_regex]
  
  string = 'http://domain.com' =&gt; valid
  string = 'email@domain.com' =&gt; valid
  </code></pre>
  
  <p>thanks in advance!</p>