URL must be of the form: http://host.domain/scriptname.extension, no query string.
ie, this is a valid URL: http://abc.axx.loc:8000/abcd.aspx.
I tried to do it like below, but it doesn’t work well, anybody can help? thx.
var RegExp = /((h|H)(t|T)(t|T)(p|P)|(h|H)(t|T)(t|T)(p|P)(s|S)):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?\/\w+\.\w+$/;
Notice after the // the block [\w\-\.]+ is for the host and domain combination. It should match host.domain as well as host.subdomain1.subdomain2.domain etc.
The ^ and $ in the start and end is important so it matches the start and end of the string.
Also notice the use of \w\- because \w alone is not enough as it does not capture dashes.