I read all the regex posts first, before starting this post. I need to process a large string of html from a generated page, removing some navigation elements; I can add comments as placeholders and markers as needed before generating. I've attempted to replace the string starting with the inserted comment "<!-- SOBs -->" and ending with "<!-- EOBs -->" but I am failing. I assume it is not something as simple as: tempString=tempString.replace(/<!-- SoBs -->.*<!-- EoBs -->/gi, " ");