Simply place the things you don't want to match as alternatives at the beginning, and don't capture them.
var urlCheck = new RegExp("(?:w+\.)?google\.com|([a-zA-Z0-9]+://)?([a-zA-Z0-9_]+:[a-zA-Z0-9_]+@)?([a-zA-Z0-9.-]+\\.[A-Za-z]{2,4})(:[0-9]+)?(/.*)?");
^^^^^^^^^^^^^^^^^^^^ Match google, don't capture
Results:
< "hello bob www.numenware.com foo www.google.com bar".replace(urlCheck, "*")
> "hello bob * foo www.google.com bar"
The ?: specifies a non-capturing group.
Read more here.
If you would prefer to handle the exceptions separately then
var blacklist = /(\w+\.)?google\.com/;
string.replace(urlCheck, function(match) { return blacklist.test(match) ? match : "*"; });
This has the advantage of making the blacklist easier to manage and update without having to edit the main regexp itself.