I'm having some issues with a particular bad answer of mine that I posted about a little more than a year and a half ago. The answer does do what the OP wanted, but didn't do it in a way that reflects good practice.
The answer has attracted some downvotes and there are better ways of doing what OP wanted in other answers and comments. I figured since the answer isn't helpful and is actively harming the community (with bad information) and myself (loss of rep) it was time to vacate that answer. The problem here is that now I realize that I can't delete my own answer because it is accepted.
I quick search here on meta turned up this post on the topic. After reading through it I am now a bit conflicted on whether it is the best thing to have the answer deleted. Again, while my answer was functionally correct, there were better ways to go about doing it.
If a future reader comes across my post and sees that simple string replacements are best left to simple string functions instead of regular expressions, well then my error has given them helpful knowledge. That results in a net gain IMO - which a little lost rep is a small price to pay for others to learn from it. Then again, the post is grayed out so it may also be doing nothing for the community or myself.
Before posting this I edited the post to reflect what the better answer would have been. However it still leaves the question: Should I ask for a moderator to intervene and delete the post (if they will that is), or leave it as is in the hopes it helps a future user? My opinion at this point would be to simply get rid of it, but it technically belongs to the community, good or bad.