Code: Select all
ExtractAddress(str)
{
if (RegExMatch(str, "S)((http|https|ftp|mailto:)://[\S]+)", match))
return match1
if (RegExMatch(str, "S)(www\.\S+)", match))
return "http://" . match1
if (RegExMatch(str, "S)(\w+\.(com|net|org|gov|cc|edu|info|ly|us))", match))
return "http://" . match1
return ""
}
addr := ExtractAddress(clip)
Run %addr%
return
1. Non standard domains
Code: Select all
zoom.us
2. Cutting off the rest of the URL
Code: Select all
bit.ly/testing
Code: Select all
bit.ly