MCPcopy Index your code
hub / github.com/cipher387/quickcacheandarchivesearch / validURL

Function validURL

script.js:1–9  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

1 function validURL(str) {
2 var pattern = new RegExp('^(https?:\\/\\/)?'+ // protocol
3 '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|'+ // domain name
4 '((\\d{1,3}\\.){3}\\d{1,3}))'+ // OR ip (v4) address
5 '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*'+ // port and path
6 '(\\?[;&a-z\\d%_.~+=-]*)?'+ // query string
7 '(\\#[-a-z\\d_]*)?$','i'); // fragment locator
8 return !!pattern.test(str);
9 }
10 function buttonOpen(buttonValue)
11 {
12

Callers 2

buttonOpenFunction · 0.85
allOpenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected