Match string which doesn't start with
- by Pinky
I have a string that looks like this:
var str = "Hello world, hello >world, hello world!";
... and I'd like to replace all the hellos with e.g. bye and world with earth, except the words that start with   or >. Those should be ignored. So the result should be:
bye earth, hello >world, bye earth!
Tried to this with
str.replace(/(?!\ )hello/gi,'bye'));
But it doesn't work.