3 ms·
From that answer: "You can't parse [X]HTML with regex". I've always wondered how that came about. How come very early in the development of the web no one impo
by tzs 7y ago
From that answer: "You can't parse [X]HTML with regex".
I've always wondered how that came about. How come very early in the development of the web no one important enough for people to pay attention to them said, "Hey...wait a second. If this thing becomes popular, people are going to really want to processes web documents with their usual text file processing tools and techniques. We really outta make this thing reasonably easy to process with grep and sed and awk and Perl and such"?
- tom_mellior 7y agoThe problem isn't with the surface syntax of HTML. Anything else, like S-expressions or JSON or whatever would have the same problem. The problem is arbitrary nesting of elements. No language with nesting can be parsed with regex (modulo various copouts mentioned elsethread). But such nesting is useful and necessary for a document language like HTML. This goal is important; "we must be able to use awk" isn't.
- deleted 7y ago[deleted]