4 ms·
Why is it better? I think HTML parsers have their place, but I don't understand why people think regular expressions are not a valid tool for getting data out
by PHP-TROLL 17y ago
Why is it better?
I think HTML parsers have their place, but I don't understand why people think regular expressions are not a valid tool for getting data out of HTML. HTML parsers are only an appropriate solution if the HTML is valid, well structured and mostly semantic.
If you are dealing with invalid, code generated via Frontpage 2000 by some bureaucrat with little HTML knowledge, regular expressions will almost always be a better option.
- RyanMcGreal 17y ago> HTML parsers are only an appropriate solution if the HTML is valid, well structured and mostly semantic. Tell that to all the people using BeautifulSoup and hpricot.