$xml =~ s/<!--.*?-->//sg; [download]
In reply to Re: Removing XML comments with regex by gamache in thread Removing XML comments with regex by gasho