Tech Solutions
Provide solutions and information on C#.net, ASP.Net,WCF,JavaScript, jQuery,HTML,CSS,AngularJS,SQL
Thursday, 16 February 2017
JavaScript: Regular expression to validate URL
Please find below JavaScript code to validate URL using regex expression.
function ValidURL(url) {
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/; return regexp.test(url);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment