129
rated 0 times
[
134]
[
5]
/ answers: 1 / hits: 51092
/ 14 Years ago, tue, november 30, 2010, 12:00:00
i made that:
/^(http[s]?://){0,1}(www.){0,1}[a-zA-Z0-9.-]+.[a-zA-Z]{2,5}[.]{0,1}
and checked it with a validator but on my page it is not working:
var re = /^(http[s]?://){0,1}(www.){0,1}[a-zA-Z0-9.-]+.[a-zA-Z]{2,5}[.]{0,1};
if (!re.test(url)) {
alert(url error);
return false;
}
i get this error
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
Timestamp: Tue, 30 Nov 2010 14:23:10 UTC
Message: Expected ')' in regular expression
Line: 781
Char: 23
Code: 0
URI: http://*************************
More From » regex