Try \. : I would have thought \. would have been sufficient, but maybe something is broken somewhere or I'm just too tired to think through all the escaping requirements. Further alternatives:
Use [.] instead.
'/' is only a special character in regular expressions if you're using it to quote the regular expression in the first place; since you're not, you don't need to escape it. Or you can, and write
var re = /^(http:\/\/|https:\/\/|www\.|\/\/)(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?(\/)*$/i;
and take Javascript's string-escaping requirements out of consideration.
But the hassle you're having can be boiled down a bit if that helps:
function checkDomain(sDomain) {
var re = new RegExp("^([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+$", 'i');
return sDomain.match(re);
}
checkDomain('foo bar.com');