I have the following regex that isn't working. I want to match the string 'www.example.com' but not the string 'http://www.example.com' (or 'anythingwww.example.com' for that matter):
/\bwww\.\w.\w/ig
This is used in JavaScript like this:
text = text.replace(/\bwww\.\w.\w/ig, 'http://$&');
I know the second part of the regex doesn't work correctly either, but it is the http:// part that is confusing me. It will currently match 'http://www.example.com' resulting in output of 'http://htpp://www.example.com'.