9 ms·
No, although this answer is awesome and very well researched, it cannot match the famous answer to the question about parsing HTML using regular expressions :-)
by Jun8 3y ago
No, although this answer is awesome and very well researched, it cannot match the famous answer to the question about parsing HTML using regular expressions :-) : https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 https://stackoverflow.com/questions/1732348/regex-match-open....
BTW, I got curious about the highest scored answer and this meta answer explains how to find it: https://meta.stackoverflow.com/a/266570 https://meta.stackoverflow.com/a/266570. The highest scored answer is this one: https://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array/11227902#11227902 https://stackoverflow.com/questions/11227809/why-is-processi... (of course this is related to teh size of the community)
- bazoom42 3y agoThe famous answer is wrong though, since the question is about tokenization of XHTML (not parsing into a tree) which is indeed possible using a regex. This is why none of the condescending answers suggest a better way. There isn’t one.
- mgaunard 3y agoI can't say that comment about regular expressions is particularly good -- it isn't even true. (Some variants of regular expressions can implement arbitrary context-free grammars).
- School-Cotton 3y agoThe HTML parsing question is an annoying meme that people laugh along with to feel part of nerd culture. This one is an extremely thorough attempt at answering the question. Not comparable at all.
- antegamisou 3y ago> it cannot match the famous answer to the question about parsing HTML using regular expressions Man people on SE are cringe af ngl
- dotancohen 3y agoHave you read this one? It's got the HTML parser answer beat by a lap and a half. The only comparable answer I'd ever seen was something on Seasoned Advice, the culinary SE. I'll have to go dig that up.
- lolinder 3y agoThe best part about that RegEx answer is the moderator's note at the bottom. > Moderator's Note > This post is locked to prevent inappropriate edits to its content. The post looks exactly as it is supposed to look - there are no problems with its content. Please do not flag it for our attention. From back in the day when Stack Overflow was fun.
- Aeolun 3y agoHmm, I recently thought it would be a great idea to answer a question on SO again, and did that by first posting a link. Then I realized how useless that would be if the link disappeared, so I clicked edit and pasted the actual info. All this took like 20 seconds, but the hounds had already descended. Someone had posted a note on an answer that was literally 20 seconds old saying that it could be improved. When I responded with an offended comment they deleted all their comments, and I lost the ability to report them. That was the first, and also the last time in the past 4 years I thought to post anything there. TH̘Ë͖́̉ ͠P̯͍̭O̚ N̐Y̡ H̸̡̪̯ͨ͊̽̅̾̎Ȩ̬̩̾͛ͪ̈́̀́͘ ̶̧̨̱̹̭̯ͧ̾ͬC̷̙̲̝͖ͭ̏ͥͮ͟Oͮ͏̮̪̝͍M̲̖͊̒ͪͩͬ̚̚͜Ȇ̴̟̟͙̞ͩ͌͝S̨̥̫͎̭ͯ̿̔̀ͅ
- User3456335 3y agoYou wanted to report them for asking you to do the thing that you also thought had to be done? What would you even report them for? Giving valid criticism? Responding quickly?
- Aeolun 3y agoThere is something like malicious compliance. And just being mean spirited in general.
- nullhole 3y agoHi lolinder, welcome to HackerNews. Your comment implies that Stack Overflow isn't currently fun. You are of course well within your rights to make that assertion. However, I find that your comment may be improved by removing any implication that Stack Overflow isn't fun. So I invite you to explain your reasons and maybe consider future improving edits to your post.
- jaxrtech 3y ago“Even Jon Skeet cannot parse HTML using regular expressions.”
- hardlianotion 3y agoHe meant Chuck Norris.
- earleybird 3y agoJon Skeet is who Chuck Norris calls when confronted with a regex[0] (Apologies for the Medium link) [0] https://medium.com/geekculture/the-chuck-norris-of-programming-jon-skeet-d6aec8a69f9f https://medium.com/geekculture/the-chuck-norris-of-programmi...
- behnamoh 3y agoMy favorite is this one: A bear falls into a well. The depth of the well is 19.617 meters, and it takes the bear 2.0000 second to reach the bottom of the well. What is the color of the bear? https://qr.ae/pKqzpC https://qr.ae/pKqzpC
- philwelch 3y agoI like the work he put into the answer but he totally flubs it at the end. Black bears are actually dark brown and brown bears are also brown, so there’s no need to try and guess a specific bear species; the bear is necessarily brown.
- ziptron 3y agoMaybe I am bad at promoting, but I could not get ChatGPT3.5 anywhere near a logical process to answer this question. https://chat.openai.com/share/67998d60-0f81-410e-ba8b-ec5a0f29ec22 https://chat.openai.com/share/67998d60-0f81-410e-ba8b-ec5a0f...
- fbn79 3y agoChat GPT 3.5: https://chat.openai.com/share/9187924c-64ab-4246-a2b0-0c9cead0e811 https://chat.openai.com/share/9187924c-64ab-4246-a2b0-0c9cea... Regenerate for more languages solutions
- jiggawatts 3y agoI couldn't get GPT4 to answer it either, even with several variations on the prompt. It gets too fixated on the "bear" part, so it just assumes that the answer is "white", because that's a "common trick question". I find it interesting that it disregards the rest of the question, and just picks "the most common answer to a trick question involving the color of a bear"!