-26

My question: Extract Salary using regex from job description in php

What is wrong with that? I need help finding a regex solution.

Here is another question that has only two lines and is still there getting upvotes: How to extract text in php using regex

enter image description here

Someone commented saying I should show them how hard I tried first before I asked. Why? Another person said that the data should be stored already so I don't need to extract it with regex. Sorry, but the data is coming from RSS and not stored.

Past questions and answers of this sort are beneficial so I don't understand why newer questions and answers get downvoted and/or closed.

9
  • 9
    In general, you shouldn't use old questions as a justification for new ones, since what questions are acceptable has changed over time. The downvotes are for the lack of effort, I presume. Lack of effort is not a reason to close a question though, and your question does seem focused and clear enough to be on-topic. That being said, the [regex] tag seems to have some special status in what is considered on-topic, and your question looks like one that would be closed and deleted in short order.
    – cigien
    Mar 27, 2021 at 4:39
  • @cigien Lack of effort is not a reason to close a question though - is that entirely true? Can't this fall into at least one of the close reasons e.g. "Needs debugging details"
    – QHarr
    Mar 27, 2021 at 5:26
  • 3
    @QHarr "Needs debugging details" only applies to debugging questions. The question being asked about is definitely not a debugging question.
    – Makyen Mod
    Mar 27, 2021 at 5:31
  • 8
    I admit I was tempted to downvote your question on Main (but didn't), because you provided the text you're wanting people to write a regex for only as images. Not providing the actual text as text makes the job of anyone thinking about answering your question substantially harder and makes it much more likely that there will be problems with any solution provided. From an answer's point of view, it almost feels as if it's deliberately harder to answer your question. If you're wanting people to help you, then you should try to make it as easy as possible for them to provide that help.
    – Makyen Mod
    Mar 27, 2021 at 5:37
  • @Makyen I get your point. The statement however, referred to "a question" not this question. I found it confusing because I believe it can be a valid reason to close a question (even if not in this instance).
    – QHarr
    Mar 27, 2021 at 6:03
  • 3
    @QHarr The answer has not changed since the last time you asked it, assuming you are still asking whether OP is required to show any effort in solving the problem themselves. No, the OP is not required to do that. If they don't show any attempt at solving it themselves, it's a reason to downvote, but not a valid reason to close. Of course, as the linked Meta in that response points out, there are other reasons to close a question that are considered to be related to a lack of effort, but none of them seem to apply here either.
    – cigien
    Mar 27, 2021 at 6:24
  • 1
    @Makyen I'd like to add that not only is this an image but the data comes from an RSS feed. So, we could have been given a sample of the feed data. Helps to perhaps extract the correct part of the description and maybe sanitise it if it has something not seen in the text. But at the very least, the text should have been available. Both of these are readily available to the question asker, so posting the images involves more work for both the asker and the answerers.
    – VLAZ
    Mar 27, 2021 at 7:36
  • @Makyen The empty program usually doesn't do what people want. It is a debugging problem. They need to give a [mre]. Also, since it's not clear what's stopping them or what they do or don't understand, their question is unclear. Whether you would characterize the case as also a lack of effort is irrelevant.
    – philipxy
    Mar 27, 2021 at 9:00
  • 3
    @philipxy No, that's not debugging. Debugging is when someone tries to do something, but their attempt fails and they ask how to fix their attempt. Someone asking "how to" do something is not debugging. A "how to" question never requires code. Providing some code to frame the question, not necessarily an attempt, can be the quickest, most efficient way for the OP to better focus a question and provide details and clarity (i.e. to make the question less broad and more clear), but code and/or an attempt are not required and the "no MRE" reason doesn't apply to "how to" questions.
    – Makyen Mod
    Mar 27, 2021 at 15:54

1 Answer 1

8

Moderation standards have changed since the site was first created. You don't want to use something from 2011 as justification for why your question shouldn't be closed; the rules were different then. Also, sometimes an off-topic will fly under the radar. This site gets a ton of questions everyday and there aren't enough people moderating the site 24/7 to catch everything.

This is only speculation, but: Another thing that's different in your question than the other one is that the old question is only asking for help with one type of string. Your question is asking for a regex that will work with 3 different formats, which might be why you got the close reason that says, "Update the question so it focuses on one problem only". I don't know for certain that's why they closed it but that might have been their issue with it.

Someone commented saying I should show him how hard I tried first before I ask. Why?

There are a few reasons this is useful:

  1. It helps people trying to answer avoid suggesting something that you already know doesn't work. It is extremely discouraging to come up with a solution and get "I already tried that" as a comment from the OP. Other users are very quick to downvote answers that get this comment as well.

  2. It helps people trying to answer if they don't have to start from scratch. Something that only partially works is better than nothing. Even something that doesn't work at all will help people see how you approached the problem and can help them explain where you went wrong.

  3. As El_Vanja said on your question, it's useful to others with a similar problem see what doesn't work and why.

2
  • 3
    And showing what you already tried avoids a lot of "don't consider me <self-censored> <self-censored> I obviously already tried that so stop <self-censored> suggest such a basic things I'm not <self-censored>" comments... Mar 27, 2021 at 6:48
  • #4 It doesn't look like asking others to do all the work for you as in "give me the codez"
    – charlietfl
    Mar 27, 2021 at 18:43

You must log in to answer this question.

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