Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I have in this question: How to remove href tag from CDATA an example of an answer (of mine) which while valid, especially for developers looking to avoid 3rd party libraries, was not used by the asker. In spite of what were (in my opinion) clear instructions - the user used the wrong regex string even after multiple attempts and did not see their desired results, and so gave up on the solution and downvoted it.

As an answerer defending my rep (especially around a milestone that controls privileges) - my only immediate reaction is to delete the answer so that the downvote no longer counts towards my rep total.

I still strongly feel that this sort of answer would be useful to future visitors who aren't limited by the inability to follow instructions - but why leave it up when all that effort only leads to a loss of rep?

(I apologize for the frustration exhibited in this post.)

share|improve this question
up vote 11 down vote accepted

Assuming the answer is valid and useful, the motivation for keeping it around would be that it may prove useful to a future visitor.

The rep cost in keeping it is only -2—a small price to pay to help make the internet better—and a future viewer may very well upvote the answer for a net gain of 8.

Having said that, it looks like you're recommending regular expressions for parsing and manipulating an html document. The downvote is likely caused by the fact that many users believe this is a bad idea

share|improve this answer
I suppose that's a very valid theoretical view of the problem. My experience after about ~150 answers is that only two of those ever get additional votes as time passes, and only because they already have so many upvotes, so they draw the attention of readers. Posts with 0 or -1 rep are rarely ever read again, especially in questions with 3 or more alternative answers that have been upvoted. – Alain Apr 9 '12 at 19:58
@Alain - to some extent. By the same token, decent posts with a negative score quite often attract a "sympathy vote" - ie, "hey, this post didn't deserve that -1 - lemme rectify this" – Adam Rackis Apr 9 '12 at 20:01
(Aside - the regex solution I posted was intended to be run on the individual nodes after properly traversing the xml - the actual code posted was designed to be able to be run on the entire xml.toString() at the asker's request.) – Alain Apr 9 '12 at 20:01
re: Sympathy Votes - Touché – Alain Apr 9 '12 at 20:02
@Alain - (1) Give it time. I only have a moderate amount of rep/answers, and I still get upvotes from very old questions on a semi-regular basis. (2) The points system is not the most important part of SO; the transmission of knowledge is. I posted this answer a while back, which got voted down, but it's useful to the community (describes a previously-unknown feature), so I left it. Your rep is just some points on some site, but your answer is a potential lesson in programming to a new programmer. – eykanal Apr 9 '12 at 20:04
@eykanal - Really well put. Thanks. – Alain Apr 9 '12 at 20:07
Sidenote: While regex is definitely not always a good solution for HTML parsing, and is frequently a terrible solution, there are occasions where it is perfectly acceptable or even the best solution. Whenever I offer a solution that uses regex for this, I expect to get downvoted because "never use regex for html" is religious for so many people (their blind faith makes them miss very appropriate easy solutions sometimes). I just suck up the down votes in these cases. In fact whenever I use regex for any question that isn't about regex, I feel at risk for downvotes. Again, I suck it up. – Ben Lee Apr 10 '12 at 5:13

If you got just a down-vote, that is not something to worry about.

You should not delete your answer as far as:

  • it replies to the question asked by the OP
  • it reports the correct regular expression to use for the specific case reported by the OP

Probably the answer could also say that to parse HTML/XML a parser is generally required, not a regular expression.
The answer is still useful for who doesn't want to use an external library for a similar task. Keep in mind that questions are not only useful to the OP, but also to future readers; as a matter of fact, if the question is only relevant for the OP, the question could be closed as too localized.

share|improve this answer

You must log in to answer this question.

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