snippet

HTML and regular expressions

I sort of dislike regular expressions. They're usually annoying to read and not infrequently incomprehensible without reading a book (or two) first. Still, they're useful.

I wanted to apply some regex magic to HTML content, to change words that are not part of the HTML markup. However, anecdotally, regular expressions don't play well with HTML. Still, I wasn't interested in the tags, only what is between them, so it struck me as a not impossible task.