i did post this in the javascript forum first but i have been told regular expressions come from unix so maybe someone who knows unix can help
Im using a regular expression to validate a URL.
function ValidateURL(address)
{
//the regular expression used to validate the URL
var regexpURL = new RegExp("^w{3}\.\w+\.\/\w*\.*\w+", "i"
if (regexpURL.test(address))
return "";
else
return "\n* Invalid URL\n -Valid URLs are in the form ' }
when i use just
var regexpURL = new RegExp("^w{3}\."i"
it works for the first ' but when i add in the rest it doesnt work.
I want to make sure there is www. at the start and then any number of alphanumeric characters then a period then either com or co.uk or ac.uk and the a forward slash and then an optional set of alphanumeric characters and a period and either html or htm or asp ect.
My knowledge of regular expressions isnt that great so any help will be greatly appreciated.
Im using a regular expression to validate a URL.
function ValidateURL(address)
{
//the regular expression used to validate the URL
var regexpURL = new RegExp("^w{3}\.\w+\.\/\w*\.*\w+", "i"
if (regexpURL.test(address))
return "";
else
return "\n* Invalid URL\n -Valid URLs are in the form ' }
when i use just
var regexpURL = new RegExp("^w{3}\."i"
it works for the first ' but when i add in the rest it doesnt work.
I want to make sure there is www. at the start and then any number of alphanumeric characters then a period then either com or co.uk or ac.uk and the a forward slash and then an optional set of alphanumeric characters and a period and either html or htm or asp ect.
My knowledge of regular expressions isnt that great so any help will be greatly appreciated.