How to validate a url address in jquery using Regex? -
i have searched lot didn't answer. how validate urls www.google.com
, http://www.google.com
using regular expressions? in advance.
you can use function test valid url as:
function validateurl() // return true or false. { var urlregex = new regexp( "^(http:\/\/www.|https:\/\/www.|ftp:\/\/www.|www.){1}([0-9a-za-z]+\.)"); return urlregex.test(textval); }
Comments
Post a Comment