showing results for - "javascript determine if string is valid url"
Syrine
17 Apr 2017
1function isValidURL(string) {
2  var res = string.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
3  return (res !== null)
4};
5
6var testCase1 = "http://en.wikipedia.org/wiki/Procter_&_Gamble";
7
8alert(isValidURL(testCase1)); 
9
Gauthier
31 Jun 2016
1function isValidHttpUrl(string) {
2  let url;
3  
4  try {
5    url = new URL(string);
6  } catch (_) {
7    return false;  
8  }
9
10  return url.protocol === "http:" || url.protocol === "https:";
11}
queries leading to this page
validate url in typescriptjs check if strig is urlnode check if string is valid urljs if url contains stringjs how to check for urlif str is url jschek if string is urlis url javascripthow to check if input url has http or https pythonhow to check if url contains string javascriptjs check whether its a link 3fhow to check if url has string javascriptlodash is valid urlcheck if a url contails a string jscheck if string is valid url javascriptjs check if the string is urlcheck if string is urlcheck for url jshow to check string is valid url js e2 80 9ccheck if string contains url javascriptjavascript check if nota a valid urlis url javascriptcheck if is a url in jsjs url is validhow to check if a string is a urljs check if www in url string 3fjavascript is url checkbest way to check if a url is validcheck if url contains string javascriptrcheck if url contains string in jsvalid url 2b javascriptvalid url in javascriptjavascript url validatjs check if is var is urljs check url if it contain stringvalidate url in jaavscripturl validation javascriptcheck if a string is a urlhow to check a url is valid or not in javascriptcheck if urlcheck for valid url javascriptdetect is urljs is string urljqery check isvalidurlreact check if string is urlhow to validate a url javascriptcheck if is valid url javascripthow to determine if url is validnode check if it is a valid urljs if string contains urlhow to check a url in javascripthow to check if a string is a url nodeadd http only before valid url in jsgiven string is url determine ifjavascript detect string if urlvalidator check if string can be in urlhow to check for a valid url in javascriptcheck if strong is urlcheck if string is url javascriptcheck if a url is valid in jshow to check if url contains stringregex check if string is valid url javascriptcheck if url has a stringvalidate a url in javascriptcheck if its uri jscheck string is url jscheck if url contains string jsjs test if url existsjavascript validate url existshow to validate url in javascript vanilla jsvalidating url in jsjavascript check to see if a string is a urlcheck if string is url or not jsvalid url javascriptjs if url containsjs check string is urlcheck url is valid in jscheck if something is an url javascriptcheck if is valid url jsif url contains string jshow to check given string is website link or not in angularjs isurlhow to check url in string using javascriptjavascript if url containsvalidate url javascriptget if string contains url javascriptcheck if a string is urldetect url in string javascriptsee if string is an urljavascript check if is valid urlhow to check for valid ur 3b in node jshtml input check if proper urlcheck for url in a string validate if string is link javascriptjsverify if url have protocolscheck is url javascriptnode check if url is validcheck if string is a url jscheck url in string javascriptcheck current url contains in javascriptjavascript check url is validcheck if string is url in node jsjavascript is valid url 3fif urljavascript check if a url is a urlhow to check if url contains string jsjavascript check if a string is a urljavascript check if url containsif url contains javascriptjs check if url contains stringtypescript check valid urljavascript how to know if is a urlcheck if url contains a string javascriptja string check urlhow to check if string is present in url or not jshow to check whether url is valid or not in javascripthow to check url is valid or not in javascriptinvalid link validation in jshow to check url validity javascriptvalidate url argument jsdetect if string is urlcheck if string is url in javascripthow javascript can check urljs detect url in stringhow to check the valid urljs valid urlhow to check if its url in javascriptjavascript return valid part of urljs test if valid urlregex to check if given text is url javascripthow to check if valid urljavascript check if string is urljavascript function check urljavascript valid urlisurl 28 29 in javascripthow to validate link in javascriptjavascript string if urlvalidate if url is validjavascript validate url return true if valid urlhow to check if a url is valid in javascriptcheck if string is url or not javascriptif something is a urljavascript is string urladd http only before valid url in javascriptcheck if string is urifind if url in stringjs check if url workshow to check if url is a valid url by javascripthow to check for a matched string in url javascriptjs check if text is a valid urljavascript valid urljs check if string is urihow to check if url is valid javascriptcheck if a javascript string is a url javascript see if something is a urljavascript check if something is a urlhow to know if string is urljavascript show link if string has urlcheck if url has string javascripthow to check is a string is a valid urljs check string urlchek is url in jsif url javascriptjs check if urljavascript check if url is reachable and contains datahow to check for the valid url format in javascriptcheck if string contains url javascriptjs cheeck dfor valid urltypescript check if string is valid urlcheck to see if the url is valid or not in jsif url has javascriptcheck if string is url onlinejs check if url is validis valid url jshow to check its url or or not in javascriptcheck url with javascripthow to check if a string is avalid url in javascriptcheck is is valid url javascriptcheck url is valid or not in javascriptjavascript test if link is validcheck if url has string jsjs validurlvalidate url in javascriptjs check if url is availablecheck if url is valid jscheck if url contains 3f symbol javascripturl validator javascriptjavascript if page url ishow to check whether url is valid or not in typescriptif something is in urlnodejs check if url is validurl string problem jshow to check if the url is validjavascript how to check if url is validjavascript check if url contains paramjavascript check url containshow to check if something is a valid url javascriptcheck if string is a url nodejs check if text contains a url or mediajs check if url contains a stringverify input is valid url javascriptcheck valid url in javascriptcheck if text is a url jjavascript current url containsjavascript check if urlcheck valid url jshow to check vaild url in jsreact check if text is linkjavascript check if url has stringjavascript get valid urlhow to check if string is urlcheck url in jscheck if url is correct javascriptcheck if string is a url node jshow to validate url in javascripthow to check current url contains string in javascripthow to check if the page url contains string javascriptcheck if link is valid javascriptjavascript check url js check if url has 23check url jsidentify valid url jsjs check if strning is urlcheck if string is uri jshow to check for url stringcheck if a url is valid with ext in jscheck if url is valid online javascriptjavascript if current url containscheck the url is validcheck if a valid link jscheck for url in javascriptjavascript check if valid urlnodejs find if a string is urlnode check if string is a valid urlcheck string contians url in jsjs is string is urlcheck for a valid url or hostname jsvalid url jscheck website url is valid in jsvalidate website jshow to check if a url is validjavascript check if url contains 2fhow to validate a url in javascriptcheck if it 27s a url jscheck for web links in string javascripthow to check url contains string in javascripthow to make sure a url is valid javascriptjs check if url is 2ajavascript check string in urljavscript check if string is urlis url in jshow to check for url string javascrptjs how check url valid or notcheck string is url javascriptcheck string is url or not in javascripthow to check if something is a valid uri javascriptcheck if text is a url jshow to check if something is a urlcheck if is url javascriptvalidate https url javascripthow to check string is url or not in javascripthow to check string is url in jsjs check url truecheck url javascriptcheck a url is validcheck string urlhow to check valid url in javascriptjavascript check url is valid or noturl javascript validationfunction to check if url is validjs is valid urljs string is urljs check if string is valid urljavascript determine if string is valid urlcheck with javascript if url containsvalid url javascript functionjavascript how to check if string is valid urlvalidate url jsjs validate urlcheck if args is url jscheck if string on current url javascripthow to check if a variable is a url in javascriptjs check if valid urlcheck whether string is url in javascripthow to a check a url in javascriptjs string url validatehow to url is not stringjs regex to check if text is valid urljs check if url is email addresshow to know if a string is a url in javascriptjs valide urlhow to check given string is a link or not in angularjs check if string is urlcheck if url contains string javascriptjavascript check url contains stringis url jshow ot check if a url is validcheck url validity jshow to get if from url in jshow to check if the url contains a given string in javascriptcheck if url is correct jscheck if string in url jscheck if url is valid javascriptjavascript function to check valid urljs check is urljavascript check valid urlcheck if url is valid stringjavascript if url containshow to know if given url is valid javascripthow to check string for urlcheck if valid url es6check for an url jsjs url has stringreact how to check if a url is onlinehow to check if text is linkjs check if url in string 3d truecheck if string is a url react nativehow to check if url is valid if url contains jsjs check url validcheck is is valid urljavascript valide urlnode check if valid urlto find if url is validhow to figure out if a string is url in javascriptif url com valid javascriptjavascript check if string is a urlcheck if url javascriptjavascript check url stringjavascript check what the url isdetec if a string is linkjavascript check if link is validcheck if url contains text javascriptjavascript if string is urlcheck if a string is an urlnode check if string is urlnodejs check if string is urlhow to check if the url of a page exist jsjavascript check if an url inage is validcheck if valid url urilibcheck an url jshow to check in string is a url in jsjavascript check if string is a valid urlif url contains string javascriptcheck url for string javascriptjavascript validate urlcheck if is valid urljavascript check if url isjs check if string is utlis valid website check in javascriptcheck if string is url jsregex check if valid url in jsjs validate if is urlcheck if a string is valid urlcehck if current url contains jstypescript validate uri routehow to check if text is a url in js 3fcheck url is valid jsvalidate url domain name in jsjs check if url containsjavascript check if current url contains stringcheck if string is a url reactdetect if is url javascriptjavascript if url isjs check if string is a urlurl validation in javascriptjavascript detect string is a urljs url validationhow to check if a var is a url in javascriptcheck if valid urlcheck string for url jshow to check if a url have a specific stringhow to check a valid url in jscheck if url contains javascriptcheck if url jscode to check if something is a valid urlcheck if something is an url javascriptvalidate a url javascriptcheck if a url contails a stringcheck string if url jsjs check url containses6 check for urlverify entered url javascriptjs test if variable is urljs detect string is urljavascript url validationjs check if value is urljs how to see if url contains a stringhow to check if a string is url in javascriptcheck string is urlhow to validate whether given link has a valid document or not javascriptcheck if a string is a url javascriptcheck if url has specific string jsnode js is a valid urlcheck if a url is validcheck url in javascriptcheck if a valid urljavascript check for urljs url validadtorcheck if url exist javascriptjs check valid urljs see if string is a urlcheck if it is valid urljs check uri is validjs check if is urlcheck if valid url javascriptif url contains one string then how to check in jshow to check html is link jsjavascript check if the string is urljavascript url is valideif url is javascriptjs if url isangularjs regex link checkerhow to check if url contains a paramter in javascriptjavascript check if url contains stringjavascript check if url is validcheck if url is validfunction check if url contains stringjavascript check if url exists javascript check if text is urlhow to find string is web url or not in javascriptis 3d 3d valid urljava script check valid url or nothow to check url string jsvalidate url with javascriptjavascript url checkcheck if js string is urljavascript check if url containjs is urljavascript determine if string is valid url