I want to validate url started with http/https/www/ftp and checks for /\ slashes and checks for .com,.org etc at the end of URL using regular expression. Is there any regex patttern for URL validation?
2 Answers
I am use the following code for that
String lRegex = "^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
btw a search in google and you would find the solution by yourself.
3 Comments
psisodia
it is not checking for www if I write www.abc.com
Tharok
psisodia: "www" is not necessary in URL address
user3145373 ツ
@Stefan Beike : Shall it will check for
192.168.67.90/mysite/page1.html url ?
URL& connect to it? Best test ever.