Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

validate URL in javascript

function isValidURL(string) {
  var res = string.match(/(http(s)?://.)?(www.)?[-a-zA-Z0-9@:%._+~#=]{2,256}.[a-z]{2,6}([-a-zA-Z0-9@:%_+.~#?&//=]*)/g);
  return (res !== null)
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #URL #javascript
ADD COMMENT
Topic
Name
3+4 =