I've been hanging out in the regex 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.
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?
U+2615 HOT BEVERAGE
!\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.