I am trying to see how to use reg expressions to replace a url up to the .com, with something like local host. I am not a guru with expressions, so having a lot of troubles doing this. It is so we can have a Chrome extension for our localhost, and swap all urls to point to local host for debugging. So the expression needs to find anything like the following:
*.com/ --> and beyond stays the same, but up to the .com is swapped with our temp string value.
Thanks in advance
url = url.replace(/^.+?\.com\b/i, 'http://localhost');