Everyone has his/her own reasons for doing it, but I might offer one suggestion. You stated a problem that you had, with the limitation that it needed to be done with regex. You didn't explain *why* it had to be that way, which might have helped your credibility. But the most serious problem, IMNSHO, is that you didn't show anything about how you tried to solve it yourself.
You probably should check out How (Not) To Ask A Question. An important step in asking a question is showing what you've already tried, posting the code that didn't work. If you're so blocked you can't even think of where to start, then post some information about where you looked for answers. People want to see that you've made some effort to answer the question yourself, instead of just asking someone else without even trying.
Personally, when I see a limitation like, "it has to be a regex", it sets my spider senses tingling. One, it sounds very much like homework. Two, it suggests that the problem may be the restriction itself. If you had posted some explanation about why it had to be a regex, it might have helped your credibility a bit. Example: "My PHB only knows about regexen, so I have to do it that way".
Finally, yes, the votes you get on your questions do affect your XP. XP is a measure of how well liked your posts are, basically. It's a way of encouraging people to post well-considered questions in a helpful way. It encourages people to come to the Monastery and try to learn Perl, and try to help others with their questions. Now you see that a certain way of doing things doesn't get many up-votes. Your XP was affected, so you're trying to figure out how to avoid the mistakes that caused that. The incentive is working. But if you were to get 10 million XP points, would you be any better as a programmer?