I've to check if a string contains the hostname
my 5 cents and it seems to work but not being at all
a regex guru ..... :)
var re = new RegExp(window.location.hostname,'i'); alert(re.test(str));
and so on ....