tom13 Posted April 22, 2012 Share Posted April 22, 2012 Hi folks, I've got a big string with many HTML comments. I wish to strip them all out. An example snippet: <font face= "times new roman,times"><!--[if !supportFootnotes]--><span class= "MsoFootnoteReference"><span style= "font-size: 12pt; My code: $fileHTML = StringRegExpReplace($fileHTML, "<!--(.*?)-->", "") Unfortunately, this has no effect at all on the above code. Am I doing something wrong? Link to comment Share on other sites More sharing options...
tom13 Posted April 22, 2012 Author Share Posted April 22, 2012 $fileHTML = StringRegExpReplace($fileHTML, "(?s)<!--(.*?)-->", "") That fixed it! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now