28

See this question and all the others that get posted like it!

The regex in question is not even a valid regex!

Questions like this really are "too localized" as they will NEVER help anyone else on the internet because of their specificity. Both in content and temporal nature!

But they are also "too broad" as well, because regular expressions vary in implementation and are very well documented online and in books in general.

Places like regex101.com can answer these questions if you just type the regex into their box!

We need a close reason for things like that that will not be subject to nit picky reopen votes.

Found this after reading the link Shog9 posted.

I keep seeing decent questions closed as "too localized". I don't know what "too localized" means and frankly do not care, I just want SO to stay a nice and helpful place. Let's be nice to new users and each other and end the closing madness." - MK01

This is the attitude that is a cancer to the site, and it has plagued the community since the "Summer of Love" campaign. If this is the prevailing reason that close reason was removed and the powers that be still think it is a good thing to cater to selfishness demonstrated by users like this then so be it. It is a sad state of affairs if this is the case.

Maybe we need a different semantic.

Like a close reason that says "This is so specific to your problem that it will only help you in this single instance and no one else in the future." and let it stay open until it gets an accepted answer and then delete it and remove any votes associated with it.

Because that is what the problem is, there are so many extremely narrow questions with broad titles about regular expressions that when you search you can not find anything useful to your question that is more general and useful because of all the noise.

You click and click and click and click and they are all about "how do I match this extremely specific data that I can not even post because it is confidential, but I posted AAABBB#[:2134324-43234 which is sort of the format but not the real data.

And the answers are more likely than not just the solution with no explanation and not even formated in code blocks. That does not help the community. But then the charter of SO no longer mentions "high quality questions and answers", it pretty much promotes the opposite.

17
  • 13
    So suggest one. Preferably one that won't be primarily misused on useful questions.
    – Shog9
    Commented Jan 13, 2015 at 23:13
  • Related: meta.stackoverflow.com/questions/252868/…
    – Shog9
    Commented Jan 13, 2015 at 23:18
  • 2
    Note that the regex in stackoverflow.com/questions/27932761/… is a valid regex in Java. Just paste the whole thing between quotes, and it will compile. The regex itself is not too meaningful, though.
    – nhahtdh
    Commented Jan 14, 2015 at 2:59
  • 5
    You've got about a 99.3% false positive rate on that search there, sooo...
    – tckmn
    Commented Jan 14, 2015 at 3:58
  • example
    – user177800
    Commented Jan 14, 2015 at 16:57
  • 1
    ad example: Maybe you're not fully understanding the problem. The FAQ will show you, that you can make characters/subpatterns optional by putting a ? after it. Something like (-SNAPSHOT)? but OP also wanted to capture -SNAPSHOT, which requires a lazy .*? before. That's the reason, that it's not a duplicate or at least not a duplicate of the FAQ. Also it's not too specific because it shows the effect of greediness before an optional part, which could cause unexpected behaviour in different situations. But yes, similar questions exist.
    – Jonny 5
    Commented Jan 14, 2015 at 18:15
  • 4
    *It means the question is a dupe of Reference - What does this regex mean? Commented Jan 14, 2015 at 22:35
  • 1
    The word "too localized" never really communicated what the close reason actually was. I always understood it to mean something more like "not abstract enough". "How do I add two numbers" was not a too localized question, but "How do I add 5 and 7" was. Commented Jan 14, 2015 at 23:25
  • @Shog9 - the definition of "too localized" was pretty explict at one time in the reason. It said to the effect "this question as it is worded would have no usefulness or benefit to the general population". Maybe I am the only person that reads the descriptions?
    – user177800
    Commented Jan 15, 2015 at 2:54
  • When Is a RegEx Question Too Localised?
    – user177800
    Commented Jan 15, 2015 at 2:59
  • How specific is too specific when it comes to questions?
    – user177800
    Commented Jan 15, 2015 at 3:00
  • 1
    There were... A lot of different interpretations. meta.stackexchange.com/questions/132319/…
    – Shog9
    Commented Jan 15, 2015 at 3:00
  • 2
    "This will only help you and no one else"? Seriously? (a) you are in no position to decide what will help "anyone else"; and (b) what exactly is wrong with helping one person? Where does "help"start? Two people? 100 people? Lighten up.
    – EML
    Commented Jan 16, 2015 at 10:37
  • 1
    The same problem exists in the SQL tag. Many questions are "plz debug my query". And the problem is usually covered 99% by a more general very common issue.
    – usr
    Commented Jan 16, 2015 at 10:49

5 Answers 5

96

Your search is a bit greedy; it includes answers, and posts that just happen to contain those words somewhere in the body. This is probably a bit closer: https://stackoverflow.com/search?q=title%3A%22what%22+title%3A%22regex%22

...which doesn't actually turn up very many questions. But it got me thinking: this isn't the first time someone's complained about regex questions, in particular the vast majority of regex questions that are specific to some bit of confusion on the part of the asker but never benefit anyone else. Folks even built yet another reference because of this.

And bizarrely, folks using the word "regex" in their titles does appear to be a pretty solid indicator of a dodgy question. Not 100% of the time, but... Well, maybe 60-70% of the time. Enough to be worth taking a minute to provide some extra guidance for the folks who could perhaps waste a bit less of their time that way. So, I did this:

24
  • 52
    brilliant.... now you just need to figure out how to detect homework questions, and in your spare time figure out cold fusion Commented Jan 14, 2015 at 0:24
  • 2
    @psubsee2003 he's cold already, I don't know if he fused himself with a body yet.
    – Braiam
    Commented Jan 14, 2015 at 3:06
  • 4
    While regex101 is a good place to write a debug regex for PCRE, Python (2 to 3.2), JavaScript, it is not a good place to debug for Java and .NET. I think you should mention that the regex wiki page has a list of regex engines to use for specific flavor of regex, rather than pointing them directly to regex101
    – nhahtdh
    Commented Jan 14, 2015 at 3:16
  • @nhahtdh: Agreed; also, Rubular for Ruby/Oniguruma, as you can't test any of its many extensions elsewhere.
    – Amadan
    Commented Jan 14, 2015 at 3:26
  • @Amadan: Newer version of ruby uses a port of Oniguruma, which adds some more features, if I remember correctly.
    – nhahtdh
    Commented Jan 14, 2015 at 3:35
  • 1
    @nhahtdh: Yes, that's my point. There is, AFAIK, no other online regexp tester that works for Ruby i.e. Oniguruma/Onigmo syntax.
    – Amadan
    Commented Jan 14, 2015 at 3:38
  • 47
    "Your search is a bit greedy" Haha, regex puns.
    – BoltClock Mod
    Commented Jan 14, 2015 at 3:59
  • 6
    SE needs more solutions like this than the ones like "just close it and tell him to go **** himself" solutions. Those are easy-way-outs, anyone can be the mean guy, you don't need any skills for that.
    – hattenn
    Commented Jan 14, 2015 at 6:44
  • 3
    @hattenn Apparently you haven't read a close reason in a very long time, or looked through the help center, like, at all. Both are filled with this type of information and advice for each close reason, for anyone interested in actually interested in improving their question. Unfortunately this solution will have the same problem that you have with close reasons; people see someone telling them that their content is problematic, and they tune out everything else and get defensive (or ignore it).
    – Servy
    Commented Jan 14, 2015 at 16:15
  • this is a great attempt, but it is way to passive and will just be dismissed by the help vampires ...
    – user177800
    Commented Jan 14, 2015 at 19:16
  • 1
    @Servy, I believe proactive measures are more effective in helping people, than punishing people and expecting to teach them with that. The distinction here is similar to helping young people stay away from crime with intelligent methods vs punishing people to death after they commit a crime. I will always applaud the former. Mind you, just as I am not saying that crimes shouldn't be punished, I don't have a problem with questions being closed for any reason, I just see people get really mean on SE sometimes. And unlike many people here, I don't believe meanness is called for or helpful.
    – hattenn
    Commented Jan 14, 2015 at 20:13
  • 1
    @hattenn Closing a question isn't being mean. It's being helpful. It's preventing the question from being flooded with crap answers and giving the author (and others) an opportunity to fix the question so that it will attract great answers. Giving someone a bunch of advice before they ask a question that you know they're just going to ignore is certainly well intentioned, and if it helps, I have no problem with it, but SE does it all over the place and it has a very minimal effect. People clearly pay no attention to these preventative measures.
    – Servy
    Commented Jan 14, 2015 at 20:17
  • @Servy, I think there is a misunderstanding between us. I am not saying closing a question is mean. All I am saying is, it should always be preferable to come up with solutions that prevent people from asking questions that will be closed. But then again, if a question needs to be closed, it is always better, IMHO, to give pointers to people in the right direction instead of acting hostile and making rude comments. I am not against closing questions, I just think a lot of people look down upon people very easily and get hostile quickly on the internet.
    – hattenn
    Commented Jan 14, 2015 at 20:43
  • 1
    @Ben Click the picture- It links to the ask page set up for this pop up.
    – Kendra
    Commented Jan 14, 2015 at 22:52
  • 4
    Helps if I get the, uh, regex right @ben. Maybe I should've asked on SO... (try it now)
    – Shog9
    Commented Jan 15, 2015 at 4:03
14

Regex is hard!

At least at first, Regex is not easy. I should know. I pored over the documentation a lot. I came to a problem and I still didn't know the answer so I read the documentation again. Still no luck. So I post a question on SO and the answer seems so easy and self-evident that I experience a euphoria of amazement and gratitude.

The quality of my work would have suffered harm had I not had access to SO. You might say that is not SO's problem. Maybe not. But if many people are willing and able to help me, then why should they be discouraged. Quite the opposite, they should be heartily encouraged.

You would be surprised of the number of Regex questions that appear to solve one person’s problem but actually are useful to many. Who will judge that?

I would be livid had my Regex questions been tossed with a cavalier attitude, like “you should already know”. What a mess. I would like to think my Regex questions were quality questions.

I realize someone needs to address low-quality. And that is a good thing. I applaud the often unthanked moderation efforts. Please don't take this a an anti-moderation rant. Rather I would like to shout out: BE NICE TO THE BEGINNERS. I was one not so long ago.

Cheers and thanks for your efforts to make SO a better place.

3
  • 4
    Other than the "BE NICE TO THE BEGINNERS" mantra, there is a lot to agree with here. The rules must be applied consistently without regard of who asked the question. If the answers are useful to anyone with the same problem and the problem is searchable, then the question should be fine. Commented Jan 14, 2015 at 14:24
  • 7
    I took the liberty to glance over the questions you have asked (first, second) and I don't think they fall into the category of questions we are talking about here. Your questions look fine to me. They ask “What regex can solve X?” Others who also want to solve X can search X and find such questions and benefit. But reverse-engineering questions “What does this regex do?” are not likely to help anybody else unless they are confused by the exact same regex which seems very unlikely.
    – 5gon12eder
    Commented Jan 14, 2015 at 17:41
  • 4
    @5gon12eder: Even though the title "What does this regex do?" is not likely to be helpful, Google will capture the text of the question and answers together. Therefore, an answer that has text such as "This regex appears to validate international postal codes" will cause the question to show up in a Google search for [ postal code regex] . That would make the question useful. Commented Jan 14, 2015 at 18:24
11

Just use "Too Broad." It's the same close reason that we use on sendmetehcodez questions that amount to work orders.

If you're feeling especially charitable, you can refer them to https://www.regex101.com/, which will automatically decipher and explain any valid regex in detail.

Any question that requires a book chapter to answer properly is Too Broad. Questions that are Too Broad typically lack any context about the OP's level of expertise, which is partly why we strongly suggest that askers "show their work."

6
  • 12
    ...or close as a dup of stackoverflow.com/questions/22937618/…
    – Shog9
    Commented Jan 13, 2015 at 23:17
  • nobody votes to close these as "too broad" they think the exact opposite, since the answers are very specific
    – user177800
    Commented Jan 14, 2015 at 15:03
  • 1
    @JarrodRoberson Specific, yes. But too long.
    – Robert Harvey Mod
    Commented Jan 14, 2015 at 15:44
  • 2
    "too localized is the most correct, we need that reason back.
    – user177800
    Commented Jan 14, 2015 at 15:54
  • 4
    I'm not sure I agree. Many examples of regexes with explanations could be very useful to others, regardless of how specific the individual regexes are.
    – Robert Harvey Mod
    Commented Jan 14, 2015 at 15:58
  • @JarrodRoberson: "Too localized" should not come back, as it is never an appropriate close reason. See my answer. Commented Jan 14, 2015 at 22:49
6

We got rid of the "too localized" close reason for a good reason: it's an incredibly arrogant assertion to make. It is equivalent to saying "because I cannot imagine that anyone else will be helped by this question, it will never happen at any future point," which is not too different from declaring yourself omniscient.

More than once I've searched for help on some dark corner of whatever programming problem I'm working on, only to have Google serve me up a SO question that was perfect... except it was closed as "too localized."

Please, let's not try to bring it back, even for something as horrible as regex issues.

1
  • 7
    That's even worse than Google turning up an unanswered question you yourself asked a few years ago and forgot about.
    – Ben
    Commented Jan 14, 2015 at 22:46
1

This is, I think, a good example of trying to use a close vote as a super down-vote. Re-hashing what's already been said is pointless, so I'll just link to it:

https://gaming.meta.stackexchange.com/questions/5498/a-close-vote-is-not-a-super-downvote-please-dont-use-it-as-one

You must log in to answer this question.