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?
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