Yeah, for me regex on HTML is basically so that I don't have to include an HTML parsing dependency for a simple scrape. Also, regex is essentially plain text, so it is far easier to serialize than whatever HTML library method calls would serve the same purpose. I mean, in theory regex doesn't work with arbitrary HTML, but with a known structure it's usually fine, and if the structure does change on you then there's just as good odds that your HTML parsing methods will no longer find what your looking for either.
View all comments
Show parent comment
1
u/10BillionDreams Sep 09 '17
Yeah, for me regex on HTML is basically so that I don't have to include an HTML parsing dependency for a simple scrape. Also, regex is essentially plain text, so it is far easier to serialize than whatever HTML library method calls would serve the same purpose. I mean, in theory regex doesn't work with arbitrary HTML, but with a known structure it's usually fine, and if the structure does change on you then there's just as good odds that your HTML parsing methods will no longer find what your looking for either.