I've seen a lot of questions tagged with regex and no additional tags. These questions are often impossible to answer because regular expressions are so dependent on their engine's capabilities. Sometimes you can guess from the question or code sample which technology is being used, but often you can't. This reality is clearly recognized by the tag authors as the description practically pleads for users to add another tag with the tool or programming language implementing the regex:
There are many different dialects of regular expressions, all subtly different. Therefore, when asking questions, always include the tag for the specific programming language or tool (e.g., Perl, Ruby, Python, Java, JavaScript, vi, Emacs, sed, Lex, grep, etc.) you are using. Otherwise, you may get answers that won’t work for you.
Then I read the old blog post about the Death of Meta Tags:
Meta-tags are actually a subset of a larger problem that I usually call dependent tags. These are tags that don’t say anything by themselves – you can’t tell what the question is about unless they’re paired with some other tag (or several of them). These tags are a problem because people don’t realize this and will often use that as the question’s only tag.
While regex does, technically, "say something", it usually doesn't say enough to answer a given question.
See:
- https://stackoverflow.com/questions/14712376/identifying-the-correct-closing-bracket-using-regex
- Regular Expression to extract snippet around search term
- Insert whitespace before every capitalize letters in quotes using regular expressions
In this case, the question was only answerable because the OP provided the technology in a comment (the desired regex wasn't possible in Notepad++, which uses a very unusual regex syntax) - Reqular Expression with pipe
In this case, a general answer is provided which works with most regular expression flavors, but it's impossible to know if it will work for your problem since you may be using some weird regex flavor. It has very little value for other visitors and may even be perceived as 'wrong' if the visitor knows little or nothing about differences between regex implementations. - Regex Capture Groups on a Variably Formatted String
regex seems like a very problematic tag. While it can barely stand on its own (most often it can't), the only other solution I can think of would be to create dozens of [tool-regex] style tags (which is very ugly and presents its own set of challenges):
Is it worth splitting up the regex tag in multiple tool/language-specific tags? Or is it better to have a single tag which must nearly always be dependent on some other tag (whether supplied explicitly or via a comment)?
WHY BOTHER?
(Bringing some of the issues raised in the comments up to the question level...)
Questions tagged only with regex and no additional information in the question/comments about the tool being used are almost always impossible to answer without additional information.
In some cases, however, an answer is offered (often by someone with little knowledge of regex engine differences) and, by luck of the draw, the given regex works with the OP's implementation. In such a case, you have something even worse then a question with no answers: a question with an answer that is virtually worthless to future visitors. With such questions/answers, it's a crap-shoot: it'll either work with your regex engine, or it won't (which, to a "newbie", makes it look like the answer was wrong). In my opinion, the quality of the SO site suffers when such questions are allowed to proliferate.
From the discussion so far, it seems that there are four options:
- Split the regex tag into multiple tags by technology/tool
The consensus on this option seems to be a fairly resounding "no":
The difference between a .net-regex and a php-regex is microscopic. There's no need to have different “regex for phone number” questions in each of these. ...
there's not nearly enough closing of duplicates — and if you split the tags, that'll only make it worse.
~ Gilles
Taking this into account, I don't think it would be reasonable to undertake an insanely massive retagging of all SO questions (and I'm not sure it would even be deterministic). Also note that it would lead to a manifold increase in the total number of tags.
~ Lev Levitsky
I think splitting the regex tag into multiple tags is overkill for a problem that already has a solution (add another tag). Splitting the tag would make matters worse for a large class of current questions tagged regex.
~ Bill the Lizard
- Make regex dependent on another tag
In other words, require that a user include a "primary" tag along with "regex" (which, by implication, would be a "secondary" tag). This option has already been explored, somewhat: Could we make tags imply other tags?
Jeff Atwood's response was, simply, "we will not be doing trees, in any way, shape or form". While the concept of primary/secondary is not exactly a tree structure, Jeff's "in any way, shape or form" would still seem to preempt this idea. (After all, would html be a secondary tag?)
- Show a message to users tagging their question with regex encouraging them to include another tag
I think this one carries merit. While not requiring users to include another tag (no tree structure!), it at least signals to new users that some additional information is typically expected. Perhaps tag wiki editors could set a couple well-defined flags (such as "Suggest user include another tag") for the tag without having to get too specific.
People are already doing this in comments, so we might as well automate it to make it a little bit easier to answer these questions to begin with.
~ Bill the Lizard
This is also already documented in the tag's info ("always include the tag for the specific programming language or tool"). The idea is to make the suggestion automatic and a bit more in-your-face (so that we don't have to constantly ask "what tool are you using" for OP's who don't ready the tag tool-tips).
- Do nothing
Always an option. Admittedly, comments generally take care of the problem and the language or tool can often be inferred from the question. There is, as Gilles pointed out, quite a bit of overlap between major regex engines, so even when a language or tool is not specified there are some patterns which will work for the majority of users visiting the site. Perhaps this problem just isn't important enough to warrant much time or attention.
Personally, my vote is for #3.
regex
are unanswered. How big a problem is this really? Asking people to include more tags or otherwise provide the required information seems to be working.regex
questions. I don't know how to do a search for questions with only one tag.