Whenever someone says that you can't parse HTML with regex they are only technically correct. You can parse small parts of HTML with regex but it's mathematically impossible to write a regex parser that can handle all cases of HTML. I've parsed scraped HTML with regex before but there's easier ways of doing it. It works in a pinch though. Anybody who touts that it's impossible to parse any HTML with regex doesn't know what they're talking about.
View all comments
Show parent comment
4
u/Princess_Azula_ Sep 08 '17
Whenever someone says that you can't parse HTML with regex they are only technically correct. You can parse small parts of HTML with regex but it's mathematically impossible to write a regex parser that can handle all cases of HTML. I've parsed scraped HTML with regex before but there's easier ways of doing it. It works in a pinch though. Anybody who touts that it's impossible to parse any HTML with regex doesn't know what they're talking about.