4 ms·
"Match open tags" obviously refers to writing a regular expression which matches opening tags, not to pair opening tags with end tags. If you look at the regex
by goto11 5y ago
"Match open tags" obviously refers to writing a regular expression which matches opening tags, not to pair opening tags with end tags.
If you look at the regex which the OP themself suggests, it is clearly only intended to match opening tags (excluding self-closing tags), not search for corresponding end-tags.
- inopinatus 5y agoWell, as now expressed at hopefully sufficient length, it doesn’t just say solely that, unless one a) disregards the difference in phrasing, and then b) disengages any sense of purpose and practical utility and instead treats it like a badly worded test question. It’s kind of a shibboleth, in a way, for developer sensitivity to actual needs, as opposed to getting hung up on how clever they are.
- jcelerier 5y ago> disengages any sense of purpose and practical utility and instead treats it like a badly worded test question. Who are you to know the purpose and utility better than the person who asked the question ?
- inopinatus 5y agoOh, are they here? It’d be fascinating to hear from them. Alternatively, perhap, that hostile tone is suggesting I’m personally unqualified to interpret loosely framed questions? I suppose, since I’ve only been doing it for a few decades, I’m definitely a novice by any standard, and my tendency to observe and follow up on anomalous, incomplete, subtly conflicting, or otherwise inexplicable requirements by investigating both the timeline and substance of the original context, and the apparent motivations and outcome preferences of the author, is sheer beginners luck, and any uptick in stakeholder utility that from time to time accompanies amending recommendations following such investigative and analytical activity a sheer coincidence! So that must be it - as you can probably tell from all this smug, empty bravado, I’m really just sharing pure speculation, wild guesswork, total fluke, impertinent leaps of inferential faith, only just grasping at the vague outline of my own blind spots et cetera et cetera, and consequently yes, I’d love to hear the original intent restated from the horse’s mouth, too; but, for the meantime, I’ll read the tealeaves, systematically analyse and synthesise to the best of my ability, describe and discuss any substantive points of comprehension that I think might help enrich, or at any rate challenge, a reader’s perspective (including my own), and cross my fingers hoping to read, mark, and inwardly digest what new understanding or revealed wisdom as I can - even when it comes, as it has there and here, via diacritical allegory and dialectical hellfire. Or, finally, if you just want the TL;DR version, the reason I feel unshakeably comfortable asserting that the question author's actual purpose is normalising a nonconforming document into XHTML, by balancing open & close tags, is because they said so. It's in an answer comment about halfway down the first page. > "Can you provide a little more information on the problem you're trying to solve" "Determining all the tags that are currently open, then compare that against the closed tags in a separate array" If that's not enough, here are quotes from their other questions, posted in the minutes and hours prior: "How to balance tags with PHP", and "I need to write a function which closes the opened HTML tags." Sometimes, we just have to bother reading what's in front of us.
- shmageggy 5y agoI have to ask, is this series of comments some kind of performance art or some sort of social experiment? Or is this unironically how you write/speak/act?
- Y_Y 5y agoYou don't have to ask. Isn't there a rule about fake curiosity here? I hope this is the last comment in this bad bad thread.
- inopinatus 5y agoTo someone paying enough attention to crystallize the trichotomy, all I can say is, thank you for reading.
- deleted 5y ago[deleted]
- jcelerier 5y ago> Sometimes, we just have to bother reading what's in front of us. You are making an absolutely great example of that. I was absolutely not talking about the original SO post, but about the generally extremely entitled answers which assume the existence of a very specific X to the Y of a post.
- inopinatus 5y agoIf I understand correctly, you're suggesting "Who are you" wasn't directed at me personally, "the person" wasn't referring to the OP but all possible authors, and "the question" wasn't referring to, well, the original SO question at hand, but the class of all possible questions. If so, then I see, I think: perhaps it was more intended as "Who is anyone to know the purpose and utility (of a question) better than the person who asks that question?" I can't answer that, since I agree with the sentiment. I'm only really pondering this one specific question, made possible because there's so much extra context with which to interpret the original text. My personal hubris doesn't generalise to the class of all possible questions, and I'd struggle to sympathise with anyone making such an ambit claim. But then, maybe it wasn't even a question at all.