Regular expression validating url

I have applied this in one of my projects and its working there. ([a-z A-Z0-9] (\.[a-z A-Z0-9] ) .*)$ Let me know if you face any problem.console.log(learn Reg Exp(' // false console.log(learn Reg Exp('https:// // true console.log(learn Reg Exp(' // true console.log(learn Reg Exp(' //true console.log(learn Reg Exp('google.com')); //false function learn Reg Exp() console.log(' validate Url(' // true console.log(' validate Url(' // false console.log('https:// validate Url('https:// // true console.log(' validate Url(' // true console.log(' validate Url(' //true console.log('google.com', validate Url('google.com')); //false console.log(' validate Url(' //false console.log(' validate Url(' //false console.log(' validate Url(' //false console.log(' validate Url(' //false console.log(' validate Url(' //false console.log('//cdnblabla.cloudfront.net/css/app.css', validate Url('//cdnblabla.cloudfront.net/css/app.css')); //true function validate Url(value) ["// "//cdnblabla.cloudfront.net/css/app.css", " " " " " " " " " " " " " " " " " " q=Test URL-encoded stuff", " " ); function validate Url(value) [" " " " " Microsoft is conducting an online survey to understand your opinion of the Msdn Web site.If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site. To be precise, check this out RFC3986#3.4 Maybe you can make up a criteria for what should be an "acceptable" query string and from that you can get an answer.To clarify, I’m looking for a decent regular expression to validate URLs that were entered as user input with. q=Spaces should be encoded", "//", "//a", "///a", "///", " "foo.com", "rdar://1234", "h://test", " shouldfail.com", ":// should fail", " quux", "ftps://foo.bar/", " " " " " " " " " " " " " " " ); function validate Url(value) // protocol identifier "(? :" // IP address exclusion // private & local networks "(?!

regular expression validating url-22regular expression validating url-25

And specifically for your problem, the criteria for a valid query is still not well defined from your single example of what should fail.I have no interest in parsing a list of URLs from a given string of text (even though some of the regexes on this page are capable of doing that). /(((http|ftp|https):\/) (([0-9a-z_-] \.) (aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mn|mn|mo|mp|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|nom|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ra|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw|arpa)(:[0-9] )? I also don’t want to allow every possible technically valid URL — quite the opposite. I developed this by little trial and error and covers u r scenario.... Regards, Abhishek when we are u using that time it working fine but that is not only web site ulr format for example ( .com, , , in ) like this lot of format is there .please post answer like all url validation supported .. :[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )*" // TLD identifier "(?

You must have an account to comment. Please register or login here!