I am trying to do a case insensitive replace based on a URL where I need to include forward slashes in the text to be replaced. I know that you can remove case sensitivity like this:
str.replace(/lorem/gi, 'ipsum');
But how would I do that if the text to replace contained a forward slash such as this:
str = 'http://example.com/lorem/ipsum.txt';
and I want to replace /lorem/
with /ipsum/