0

I am trying to use find and replace to remove scripts from an HTML document. I tried to use the following regular expression, but it only selects script beginning and end tag, but leaves tag's content in place:

"</?script[^<]*?>"

For the record, I am not versed in regular expressions.

ATL_DEV
  • 9,256
  • 11
  • 60
  • 102

1 Answers1

0

There's a famous answer which addresses parsing HTML using regex. Try using something like the HTML Agility Pack instead which does the work of parsing for you, and allows you to query the file using XPath.

Community
  • 1
  • 1
Mendhak
  • 8,194
  • 5
  • 47
  • 64