Sign in to follow this  
Followers 0
tom13

RegEXP not working

2 posts in this topic

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?

Share this post


Link to post
Share on other sites



$fileHTML = StringRegExpReplace($fileHTML, "(?s)<!--(.*?)-->", "")

That fixed it!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0