I don't know why the particular person downvoted you, but your clarity/quality is absolutely terriblethe post was confusing. It was unclear whether you wanted to remove 1+ spaces, or 2+ spaces. First you answered for 2+ then you decided 1+. You have also mixed up whitespace and space in your question, stating space in the title, then whitespace in the first sentence. You should include what you have tried in the question itself, thus showing where you are stuck. If you'd done that, you might not have even clicked the post button and you'd have solved it before even posting the question.
Furthermore, a question it's so easily googlable.. e.g. google how to match 1 or more of a character or 2 or more of a character. And google how to match space.. Or google how to match >=1 or >=2 space characters
And when you posted your answer and realized you wanted {1,} rather than {2,} then you should've clarified by editing your question but you didn't. And even if your question had been clear, it's not that useful for anybodys documentation if it's so easily googleable.
You write
"This question was intended for documentation purpose. "
I don't know who is going to look at a question that mixes up space and whitespace, and say "ah great for my documentation"
And you write in comment "I don't think a question should be downvoted, supposedly, for lack of research when also an answer is provided" <-- Actually that's why the Question and Answer are separate. A Question can be downvoted and an answer upvoted.