92

You won't believe this: suffers from low-quality questions.

  • First, as you may know, there are several regex flavors in use. The flavor can impact available features, valid syntax or much more obscure subtleties.

    Except for trivial questions (which are probably low-quality anyway), knowledge of the flavor is mandatory to answer the question properly. Unfortunately, people asking regex questions often aren't aware of this or think the language is irrelevant.

  • Then, several examples are needed. If you want good answers, you have to provide some input text that should match, and also some text that shouldn't. And describe the expected behavior clearly.

  • And, of course, when asking a question, you have to provide the pattern you've tried unless you want to earn some downvotes for not showing your effort.

This reminds me of the issues faced in the tag. Take a look at this and see how well it maps to the problems I pointed out above:

Attempt to post with sql tag

I'd like to see something similar for , as I believe some tips can raise the overall questions' quality.

Here's an attempt at writing such a message, but I'm not a native English speaker so better wording is welcome:

Regex questions get better answers if they...

  • Include a tag for one specific flavor or language (Perl, PCRE, C#, Java, JavaScript, Python, etc...)
  • Show the pattern that isn't working
  • Provide some examples of input text that should match, and also ones that shouldn't
  • Describe exactly how the pattern isn't working as expected, and the desired results
12
  • 27
    Yes ! YES ! Commented Apr 19, 2015 at 13:33
  • 14
    Why can't we add this for all tags? Or at least for the TOP 40 tags or so! Like the tag wiki or tag wiki excerpt there should be a asking hint which can be edited/created like a tag wiki or so?!
    – Rizier123
    Commented Apr 19, 2015 at 15:05
  • 4
    @Rizier123 I can't think of such precise requirements that would apply for, say, almost all C# questions. Most top tags cover really broad topics, whereas regex and sql for instance are much more focused. Besides, what would you display if several of these tags are used? Questions tagged both regex and sql are rare, and in this case sql should probably have the upper hand for the notice. Commented Apr 19, 2015 at 16:15
  • 2
    @LucasTrzesniewski Well I can think of a few things which would really help: e.g. for PHP questions, that they should add error reporting and post the full and exact error messages if they get any errors. Such things would really help and maybe also prevent a few typo questions which otherwise would be posted
    – Rizier123
    Commented Apr 19, 2015 at 18:32
  • Random example, fresh from the battlefield.
    – Jongware
    Commented Apr 19, 2015 at 20:28
  • I think there is already a dialog box showing people to the big reference question and regex101.
    – nhahtdh
    Commented Apr 20, 2015 at 2:47
  • 3
    @nhahtdh there's some info in the tag info page, but let's be honest: very few people read it. Commented Apr 20, 2015 at 9:46
  • 4
    @LucasTrzesniewski: I'm referring to this one: meta.stackoverflow.com/questions/283415/…
    – nhahtdh
    Commented Apr 20, 2015 at 10:31
  • 2
    @nhahtdh I wasn't aware of this one. But it serves a different purpose. I'd still favor the tag tip, maybe we could merge both messages. Commented Apr 20, 2015 at 11:52
  • I was going to propose something like this for the bash tag. It has a tag wiki with many good suggestions, but only a handful of people ever read those. I'd like to second the suggestion to extend this to other tags by some means. The character-encoding tag wiki also has posting guidelines. There are several more; I don't think "top 40" is a good selection criterion, but the existence of (the moral equivalent of) "please please read this first" somewhere like in the tag wiki. (Disclosure: I have edited these tag wikis to provide some of these guidelines.)
    – tripleee
    Commented Apr 21, 2015 at 12:30
  • Can we have such a thing for JavaScript as well, directing people to JSHint.com (and HTML and CSS as well)? I’m sure 90% of questions could be eliminated by simply validating the code beforehand. (Wasn’t there a rejected feature request that would validate code on StackOverflow itself? I think it was rejected because it gives the impression that SO is the first place to go when code doesn’t work. With a JSHint.com message like that it would be exactly the opposite.) Commented May 29, 2015 at 4:44
  • @Xufox I doubt you could get meaningful JSHint validation with a block of code taken out of context (undefined variables etc) Commented May 29, 2015 at 7:23

1 Answer 1

11

Ok, sure, why not...

4
  • 1
    Something is sorely missing from that list, but I can't quite put my finger on it...
    – BoltClock
    Commented Mar 31, 2016 at 15:04
  • 5
    "Go to regex101 and write it your damn self?" Open to better wording suggestions there...
    – Shog9
    Commented Mar 31, 2016 at 16:11
  • 7
    I figured it out: "Regular expression questions get better answers if they..." "• Do not involve using regular expressions to parse HTML or XML"
    – BoltClock
    Commented Mar 31, 2016 at 16:22
  • Lol. But how else will I summon The Dark Lord?
    – Shog9
    Commented Mar 31, 2016 at 16:29

You must log in to answer this question.

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