This question already has an answer here:
I spent many hours researching on Stack Overflow for help on a particular programming challenge. I didn't find an answer close enough to what I was looking for. I was going to post a new question, but as I was writing it up I kept thinking of new approaches. Eventually I was able to write a function to solve the problem.
My question is, for the benefit of the community, can I post a question and the answer immediately? Is this frowned upon? Can I accept my own answer?
A secondary question, and maybe unrelated to Meta, is there a place on Stack Exchange to share code snippets? In this case my question relates to VBA and regular expressions.