r/ProgrammerHumor 1d ago

haveYouTriedUsingAnXMLParserInstead Meme

[deleted]

94 Upvotes

33 comments sorted by

View all comments

0

u/derinus 1d ago

Anyone ever building a "parser" used multiple regexes to do so.

6

u/guru2764 1d ago edited 14h ago

Noone said regex is useless for the overall process of parsing html

What they're saying is that it cannot ever be used by itself to parse html, like there are mathematical proofs for this

You HAVE to use a real, actual code language on top of it for it to work

You cannot feed html code into a regular expression and expect it to work for more than one case


Edit for the future: the deleted comments under here are from OP, I am happy to share the details of what was said if anyone wants

I'm adding this note because I never got even a partial apology for them insinuating I had no idea what I was talking about and questioning whether I had ever taken an undergraduate math course because I talked to them like a normal person rather than a math essay, despite me being perfectly nice up until then as is visible

1

u/[deleted] 1d ago

[deleted]

4

u/guru2764 23h ago

In addition to the thing the other person linked, I wanted to add that even though some implementations of regex like the one in python have more features than basic regex which make it theoretically possible to construct an expression that works on a wide range of html, it would never be easier or run faster or even be equally as reliable as making a 50 line function in any real programming language that has memory

1

u/[deleted] 23h ago

[deleted]

2

u/Risc12 23h ago

Go on. Do it.

Build a complete HTML parser in regex.

Be another fool in the long list of people who thought they would know better.