4 ms·
The "can't parse XML using regular expressions" argument is possibly flawed as it's a false dichotomy. XML is a superset of text therefore it is parseable with
by bwarp 15y ago
The "can't parse XML using regular expressions" argument is possibly flawed as it's a false dichotomy. XML is a superset of text therefore it is parseable with regular expressions, but in the context and constraint of text, not as structured XML. I.e. you can parse the textual content but not the structure with regular expressions.
It's possibly a hack but ignoring a level of abstraction for the sake of simplicity works in a lot of cases absolutely fine.
Let's also add the constraint that an XML parser can't mathematically parse broken XML whereas a regular expression can extract data from XML. That end of the problem is far more interesting.
GEB made me appreciate this fact after some rather late nights and considerable amounts of alcohol.