RegEx replace Outlook HTML spam

Use this forum if you have problems with a hMailServer script, such as hMailServer WebAdmin or code in an event handler.
Post Reply
palinka
Senior user
Senior user
Posts: 4455
Joined: 2017-09-12 17:57

RegEx replace Outlook HTML spam

Post by palinka » 2020-03-01 03:10

I was messing around with something tonight that required removing the gorillions of lines of garbage HTML that Outlook puts in messages. There's some stuff in there that doesn't fall into the "standard": <[^>]+>

Anyway, I thought I'd share. It works pretty well in my limited testing.

Code: Select all

<[^>]+>|&nbsp;|&lt;|&gt;|&quot;|&amp;|\s{2,}|v\\\:\*|o\\\:\*|w\\\:\*|\.shape|\{behavior:url\(\#default\#VML\)\;\}

Post Reply