-20

Extract last 4 consecutive digits in a string

I asked what I thought was a clear, good quality question, which was downvoted within an hour of me asking it and a few days later closed due to apparently not showing my research. My reasoning was that it's distracting and harder to read a question that contains lots of failed attempts, and easier for the answerer to simply read a list of requirements for a particular regex along with examples. My question is arguably better than most since it also contained examples of what the regex should match, which I had to carefully think about.

More importantly, this has always been standard practice for regex questions on SO, with the below being just a handful of more recent similar examples:

How to match the last occurrence of a pattern using regex

Regex to find last occurrence of pattern in a string

Find Last Occurrence of Regex Word

PHP Preg_match pattern to remove time from subtitle srt file

PHP Preg_match pattern to remove time from subtitle srt file

All of these questions remain positively voted and open, so is there a good reason that my question was treated differently to all of these?

20
  • 13
    recent examples as in some got asked over 10 years ago? Finding actually recent examples (as in asked last year) will prove a lot more challenging
    – Erik A
    Commented Aug 15, 2023 at 14:50
  • 9
    Well, moderation has gotten a bit more strict in the last few years, and many questions are now duplicates. Questions that are similar to older questions and do not show an attempt are generally not appreciated now (see the first comment on your question, attempts are expected). 10 years ago is over half the lifetime of this site, and there were a lot less related questions/potential duplicates around back then
    – Erik A
    Commented Aug 15, 2023 at 14:55
  • 1
    Sometimes the question needs to be, "I want to do <goal>. After reading <links>, I came up with <code>. It doesn't do exactly what I need. <description of what it does versus what it needed to do>. What have I missed?" Commented Aug 15, 2023 at 15:08
  • 1
    @HashimAziz Huh? 5 years ago is 2018-08-15, the current date is 2023-08-15 (at least as far as I know), they're still all more than 6 years old
    – Erik A
    Commented Aug 15, 2023 at 15:17
  • 5
    Nothing has changed in moderation in recent years. However, keep two things in mind: 1) the fact that similar questions have been already asked in the history of the site is by itself a signal that the new question may have been poorly researched; 2) take care when pointing at other questions that were seemingly better received, because curation inherently depends on who looks at them. It can happen that some questions did not receive downvotes from users who would have done so had they seen them, as well as your question may be yet to receive upvotes as it becomes useful in the future.
    – E_net4
    Commented Aug 15, 2023 at 15:17
  • 2
    Can't speak for regex or php since I don't monitor them, but perhaps the PHP tag is more tightly regulated than the regex tag. More tags attracts more eyes from different pools, and with a weak question that usually hurts than it helps. For example, the question would likely have been deleted within a few hours if asked with a C++ tag because C++ tends to clear the board crazy fast. I wouldn't change the tagging, though, you wanted a php example, instead I'd beef up the question. Commented Aug 15, 2023 at 15:18
  • 3
    With that said, I would suggest voting to reopen, because one should not conflate reproducible examples with attempts. The linked question is not a debugging question, and specifies the requirements clearly.
    – E_net4
    Commented Aug 15, 2023 at 15:19
  • 2
    "Increasingly it seems as if SE downvoters refuse to engage with content critically" In my experience, engaging after a question is downvoted (even when whoever is engaging isn't the downvoter) can end up with a less than enjoyable experience for the user attempting the engagement. The reactions, like your comment, are why many users who downvote don't engage; because the action is "evil" and "toxic" when it's far from so.
    – Thom A
    Commented Aug 15, 2023 at 15:25
  • 4
    While I don't think your question is bad, the list of questions you are citing here suggest at the very least that it is a duplicate. Commented Aug 15, 2023 at 15:53
  • 3
    Did the 2 downvotes come before, or after, your "A lot in the last few hours, but since nothing came close to working I don't see the reason in polluting the question with irrelevant attempts. See also: every other question about regex." comment? i see that there was no voting at all prior to the 2nd day, so to me that says maybe users downvoted it after you pushed back against providing more info. Obviously, bringing it up here on meta will attract even more attention.
    – Kevin B
    Commented Aug 15, 2023 at 16:16
  • 1
    @HashimAziz It’s a more complex case but should apply after removing the fluff of the specific case. This answer in specific is the most straightforward for both cases. The closure panel has guidelines on how to set apart your question from another if you think the closure was in error. Commented Aug 16, 2023 at 6:41
  • 1
    That said, I was going to write an answer here that your question was indeed good, how to turn it into a canonical (which this case deserves and so far no one has provided) and urge gold badge holders to use it as such (reopening, reverse dupe closure). However, after seeing the… creative justifications here for the original closure, it’s probably better to just take my leave. Apologies for leaving things in an unsatisfying state for you. Commented Aug 16, 2023 at 6:46
  • 1
    Regular expression questions on Stack Overflow are ... special - "I admit that I (a fairly high rep user) am afraid to post questions in the regex tag. My first question in that tag got attacked (and I deleted it). I was a ~30K rep user at the time. Since then I have felt that you needed to be really really sure you had an extra extra good and worthy question before posting one in the regex tag. (Basically, if a tag could be considered "unfriendly", then that tag is."). Commented Aug 16, 2023 at 13:32
  • 1
    cont' - See also the linked questions. Commented Aug 16, 2023 at 13:34
  • 1
    A (researched non-duplicate) question about 1 failed attempt with a MRE including what you expected & why you expected it with justification from authoritative documentation can be useful. But code you don't understand is not useful for when you are asking about otherwise being stuck; give a MRE with working code for relevant parts.
    – philipxy
    Commented Aug 16, 2023 at 22:51

2 Answers 2

17

It's just not a good question.

You've posted a set of requirements, and asked for a very broad "easier" way.
Your question lacks debugging details. Something the closure banner also states.

When asking a question on SO, you're expected to do some research yourself. The links you mentioned in your comment already contain the answers you need.

Especially the first 2:

7
  • If my question is bad, then why do all the example questions I linked - which are objectively worse than mine - remain open? Is there a valid reason that both downvotes and rules are being selectively applied? And no, the question is not a duplicate - I tried the only applicable answers in those questions and none of them matched my examples. I did that research and it was how I came across those questions in the first instance, I just didn't feel the need to place all those links in the question pre-emptively. Commented Aug 15, 2023 at 15:13
  • 7
    Why is the question missing a minimum reproducible example?
    – E_net4
    Commented Aug 15, 2023 at 15:19
  • I also didn't at all ask for an "easier" way regarding the regex at all, that was the very last line of the answer where I alternatively would settle for a PHP/Laravel solution if that would be easier than a regex, which I suppose further shows the level of effort you put into actually reading my question in order to post this handwave of an answer. Commented Aug 15, 2023 at 15:33
  • 4
    This isn't a debugging question. Why would it need debugging details? Commented Aug 15, 2023 at 15:53
  • 1
    @MisterMiyagi the question does not need debugging details, it simply lacks them. Adding an MRE is a way to show research, alternatively (unlike in case of true debugging questions) OP could have added links to similar questions or examples from other languages... Indeed the other approach is to simply accept that not showing the research will cause downvotes (as recommended by downvote reasons) and happily wait for someone providing the code. Commented Aug 15, 2023 at 17:56
  • 3
    @HashimAziz the fact your question is "better" then some other questions don't make it a good question. Also you seem to be mixing up downvotes (no research shown/not useful) vs. closing (not suitable for the site at all/in current form/duplicate). You asked on-topic question that does not show any research - you should expect and accept the fact the question need to be downvoted and either answered or closed as duplicate. It definitely should not be closed as "not showing research", but fortunately there is no such close reason on SO. Commented Aug 15, 2023 at 18:19
  • 2
    @AlexeiLevenkov The phrasing of lacking debugging details is unique to closure, and this answer explicitly references this context as well. There are strings attached to this (namely that the question indeed needs debugging details to be reopened) which simply do not apply for just lack of research. Commented Aug 16, 2023 at 7:54
13

It's kind of a waste of energy to compare the quality of your post to the quality of others' posts. The community looks at questions individually and on their own merits, not based on the past acceptance or refusal of others.

That said, the question you posted really distills down to:

I want to do X in regex. Here's some example data, and this is what it should output. How do I do this?

Even if other questions existed that phrased the question exactly like this, this doesn't change the fact that all you've done is dump requirements on us, and you're expecting that we work on this to meet your requirements.

The hallmarks of a good question indicate not just the data you tried, but also the code you tried of your own accord. Here, you clearly didn't meet that bar, so it makes sense that your question was at least downvoted.

20
  • 1
    Another handwave of an answer, as I've come to expect from Meta answers. "A waste of energy" is essentially a euphemism for "because that's the way it is, stop questioning it". I'm asking if there's actually a valid reason why supposed rules are being applied selectively, the answer to that is not to question the questioning. If the community looks at questions "on their own merits" (i.e. based on each downvoter's individual feelings and biases, with no regard for the rules and how consistently they are applied), then there's clearly a problem there. Commented Aug 15, 2023 at 16:10
  • 11
    @HashimAziz voting on SO is done entirely by the community. If you wish for your post to be upvoted, you need to convince people it's worth upvoting. there isn't some cabal of evil users going around downvoting everything
    – Kevin B
    Commented Aug 15, 2023 at 16:12
  • 4
    I won't deny that regex curation has a problem, but I don't disagree with how your question was handled specifically, since anyone without expertise in regex could have seen your question in the same light. In effect, my sentiment "waste of energy" should be interpreted more as "don't complain about how green the grass is over yonder, focus on your own lawn".
    – Makoto
    Commented Aug 15, 2023 at 16:13
  • Except that my lawn is the greenest in my neighbourhood, and yet was the only one fined by the Homeowner's Association. That's the problem. Commented Aug 15, 2023 at 16:16
  • 11
    @HashimAziz: No it isn't. You've got two people telling you what problems your question has, and you're insisting that because others got away with the same thing that you shouldn't be penalized. That is very much not the same thing as your question being better. We're telling you what's wrong with your question and how to improve it. Instead of fussing at us here on Meta about the neighbor's lawn compared to yours, get to waterin' your own and improve your question.
    – Makoto
    Commented Aug 15, 2023 at 16:18
  • 8
    @HashimAziz you only see the posts that got upvotes, you don't see the thousands that have been deleted.
    – Kevin B
    Commented Aug 15, 2023 at 16:18
  • @Makoto In what world is a regex question with several thought-out examples not better than a regex question that simply asks for requirements? Commented Aug 15, 2023 at 16:20
  • @KevinB Yes, that's the point I'm making. They got upvotes and remain open, despite being objectively worse questions, yet mine was both downvoted and now closed twice. Commented Aug 15, 2023 at 16:20
  • @HashimAziz why is that relevant to your question?
    – Kevin B
    Commented Aug 15, 2023 at 16:21
  • @KevinB Because my entire thread is about the lack of consistency? Commented Aug 15, 2023 at 16:22
  • 6
    Instead of focusing on "But this other question wasn't closed!" focus on why your question is closed. if the other questions fall in the same trap then they should be closed too, I don't see a fruitful argument for you there. We're not gonna reopen and upvote your question just because some other question got upvoted.
    – Kevin B
    Commented Aug 15, 2023 at 16:22
  • @KevinB And there's another "stop asking the question". The other questions have not been closed, that is the point. Thanks for your input. Commented Aug 15, 2023 at 16:23
  • 10
    You're effectively asking why the world isn't fair, and... it's not fair because it's not. questions are viewed and handled by whoever clicks on them, it's not always the same users and it's not always the same time of day, same day, same year, or anything else that could influence how people use their tools. It's not a double standard if it's not the same users interacting on your question compared to the other two.
    – Kevin B
    Commented Aug 15, 2023 at 16:28
  • 4
    We're not a single cohesive unit as a whole that judges each question identically, you'll get whoever clicks on it for that given day. The site has a very different set of users than it had 2, 6 and 11 years ago. you can't realistically expect voting to happen identically today, particularly when you're trying to compare a 5 day old question to questions that have been around for years.
    – Kevin B
    Commented Aug 15, 2023 at 16:32
  • 6
    20 people are speeding down the road. The police pull you over. Sucks, but it happens. I'm sticking with my judgement above. The PHP folks are less lenient than the regex folks and have more police on the streets. Commented Aug 15, 2023 at 17:53

Not the answer you're looking for? Browse other questions tagged .