14

I've been hanging out in the tag a lot lately, and I've noticed something I don't see as much in my other favorites (C#, LINQ, and a couple others): A disturbing number of regex answers are deeply, deeply wrong. I've posted about this before, but I thought that was an isolated incident or a difficult question. Unfortunately, the more time I spend in [regex], the more concerned I get. Today I noticed this fairly easy question, which has two three answers of severely low quality.

I'm not talking about small mistakes, like using \d* when you really need \d+, or typos, or getting lookbehind syntax wrong. Regex is hard; hell, I make mistakes like that all the time. Nor do I expect people to always test everything; I'm guilty of that one, too.

No, I'm talking about severe, fundamental problems with an answer. People are ignoring key points of a question, or posting a small change to the OP's pattern that does nothing to address the issue, or tossing out some mangled regex that shows a serious lack of thought or understanding. Before spending so much time in the regex tag, I hardly ever downvoted anything. Now I do it more and more often.

ALL of them!

I don't have a solution to advocate here, because I've no idea how to fix this. But it's frustrating, and it would be nice to know if anything else can be done. Is it just the regex tag that's like this? Is it just me?

12
  • 7
    You still don't like downvoting, do you? It's still the answer...
    – Cody Gray
    Commented Aug 17, 2011 at 15:01
  • @Cody - Nope, but I don't shy away from it anymore. Still, I can't fix this by myself. Commented Aug 17, 2011 at 15:07
  • 1
    HEY! Whaddya think you're doing?
    – user1228
    Commented Aug 17, 2011 at 15:23
  • 2
    @Won't - WHAT THE...ಠ_ಠ Commented Aug 17, 2011 at 15:24
  • Is it open season for Unicode characters in user names now? Cool. Just you wait until I can rename myself again. Dibs on U+2615 HOT BEVERAGE!
    – Pekka
    Commented Aug 17, 2011 at 15:31
  • 2
    @Eat Maybe I'll change my last name to ♦. Hellooooo mod status! One at a time, ladies, one at a time. Commented Aug 17, 2011 at 15:40
  • 4
    Unfortunately, you can't add a diamond... Any other Unicode character appears to be fair game, though. Not sure how well that'll work on the ladies.
    – Cody Gray
    Commented Aug 17, 2011 at 15:45
  • Maybe related? Help me defeat the barbarians in the regex tag! Commented Aug 18, 2011 at 19:55
  • @Straitjacket - That one relates to questions, not answers. It's also about people labeling their questions badly, not posting crappy information. Poorly-named questions sadly seem universal in every topic (including, arguably, this one). Commented Aug 18, 2011 at 20:07
  • +1 But: Considering you mix \d and [0-9] in the same regex for C# (stackoverflow.com/questions/5248717/…), perhaps you aren't the first one that should speak about wrong regexes :-). The reason is: on Regexes that support Unicode \d matches all this page: Unicode Characters in the 'Number, Decimal Digit' Category. As some said... Who is without sin... :-) Regexes are EVIL. You can't use them without being infected.
    – xanatos
    Commented Sep 4, 2011 at 17:54
  • @xanatos - They are definitely evil, and I love their evilness. I wouldn't DV someone for a Unicode screwup though, no matter how infuriated tchrist gets over such things. Nevertheless...touché. Commented Sep 6, 2011 at 20:56
  • 1
    Not to mention the absolute ton of regex questions that should be using parsers, or substring, or find, or whatever.
    – Almo
    Commented Aug 7, 2012 at 20:12

2 Answers 2

13

Like you said, Regex's are hard. That makes it easy to screw up an answer. Even worse, Regex questions often lend themselves to "one-liners". That makes it easy to post an answer. Combine those two facts, and you have answers that are easy to post and easy to get wrong. I'm not sure there's too much to be done about that, beyond downvoting clearly incorrect answers, and maybe even posting good answers yourself.

4
  • I'm allowing for the fact that regexes are hard. If I expected perfection in regex answers, I'd be downvoting all the things (including lots of my own answers). Commented Aug 17, 2011 at 15:12
  • I should know. Some of the only down votes I received so far were from this answer.
    – Peter O.
    Commented Aug 17, 2011 at 15:28
  • @"Glasses Face" I think it's the combination of hard and easy to post that makes it so rife with bad answers. I actually do see similar things happen when there's a one-liner LINQ answer to be had.
    – dlev
    Commented Aug 17, 2011 at 15:31
  • @Peter - I admit that one deserves a -1 in its current form, but it's not unsalvageable. I made a suggestion (which you can test here). You just need to understand the \b symbol better, that's all. Commented Aug 17, 2011 at 18:58
18

Whatever you do, please do not flag for moderator attention! This is directed not necessarily at you, but to anyone who reads this question.

Moderators cannot determine the "correctness" of answers. No one person is knowledgeable enough to do this for all questions... not even His Skeetness. We're janitors. No, not even janitors; janitors get paid. We're volunteers with mops and vomit buckets. Even if it was the job of a janitor to evaluate the correctness of selected answers, we don't have enough time to volunteer doing so.

Downvote, comment, provide alternate answers...

Hell, give them the stink eye

ಠ_ಠ

But don't flag for mod attention.

3
  • 9
    I am flagging this for moderator attention as incorrect Commented Aug 18, 2011 at 3:47
  • I'd just like to point out that I don't recall ever doing this, although I've probably been tempted. Commented Sep 5, 2011 at 21:59
  • I do find it curious, however, that moderators can't act even when there's a clear consensus that it's wrong that developed afterwards. This fails to account for time: The people who have up-voted it have driven-by and won't change their vote, even though everyone left now agrees it is wrong contrary to earlier opinion. It's a fault with using the downvote mechanism to represent consensus over time. It's better at dealing with consensus at a point in time.
    – Rushyo
    Commented Dec 19, 2012 at 15:44

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