Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Is string a valid url

Post Reply
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Is string a valid url

Post by tad.chen »

Hi,
Is there some class or unit I can use to test if a string is a valid url?

I use some open function like IsValidUrl(), but it can only check full Url. Inputting some url without scheme such as 'www.google.com' will return false by it.
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Is string a valid url

Post by salvadordf »

uCEFMiscFunctions has two functions that can also be used to validate URLs : CustomPathIsURL and CefParseUrl

You can also try the Indy components :
https://stackoverflow.com/questions/16703063/how-do-i-parse-a-web-url
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: Is string a valid url

Post by tad.chen »

Thank you for your information!
Post Reply