Tag Archives: regular expressions

21Feb/18

Regex Example: Strip Out HTML Tags

First and foremost, HTML isĀ not regex friendly. You should not try to parse HTML in PowerShell, or using regular expressions unless you’ve lost some kind of bet or want to punish yourself for something. PowerShell has things likeĀ ConvertTo-HTML that will make that kind of thing way less migraine inducing.

That said, I recently had a situation where I just wanted to strip all the HTML tags out of a string. My input looked something like this (assigned to a variable $html).

Continue reading