Created
June 6, 2015 16:06
-
-
Save jdesilvio/c467091df2c1ace30ca6 to your computer and use it in GitHub Desktop.
Simple script to verify URLs (for use in Rails apps)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'uri' | |
#enter URL here | |
url = 'https://www.google.com' | |
#verify URL | |
if url =~ /\A#{URI::regexp(['http', 'https'])}\z/ | |
puts “URL Verified" | |
else | |
puts “URL Invalid" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment