title: What's wrong with this regex to validate URLs in Ruby?
body: <p>I am passing an array of URLs to validate.  The function is below.
  It works when I pass just one URL, but not more than one.  the regular expression seems to be correct.  Where am I going wrong?</p>
  
  <pre><code>  def check_urls (list) 
      regexp =/(^$)|(^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$)/ix    
      list.each do |url| 
          if not regexp.match(url) 
              return false 
          end 
      end 
      return true 
    end
  </code></pre>
  
  <hr>
  
  <p>fixed the error. nothing wrong the regex function, just the splitting was done wrong.</p>
  
  <p>thanks to all who took time to help.</p>