r/ProgrammerHumor • • Sep 08 '17

Parsing HTML Using Regular Expressions

Post image
11k Upvotes

377 comments sorted by

View all comments

Show parent comment

14

u/ACoderGirl Sep 08 '17

It does suck, I agree.

But it's more than just invalid stuff. Html5 said that self closing tags should be written like "<br>". But this is invalid xml. Self closing tags need a slash because xml does not otherwise know that they are self closing. It just gets read as "br tag has no closing tag".