I am trying to create a JavaScript regular expression that can find a keyword in the referrers host name. It cannot be in the file path, just the host name. So... these should pass:
http://keyword.com/
http://www.keyword.com/
http://keyword.example.com/
http://examplekeyword.com/
But these should not:
http://example.com/keyword
http://example.com/?q=keyword
http://example.com/example/keyword.php
I also unsure how to create the regex. I've seen var re = new regex('actual regex'); and also mystring.search('actual regex'); . Any help would be greatly appreciated!