Hey @printer, I tried to figure out your problem using https://regex101.com
It seems as if what you want is REALLY REALLY difficult because you need a way to know when your tag is done. I would not like to say that you want is impossible because RegEx is its own programming language with experts there. But I would recommend you to try something other than spaces. I have seen people using comas to distinguish when the tag is done, like the following
#This is, #an, #example
That way you can have the program know when the tag is done. If you think that you like spaces, then comas are the way to go. Of course, that complicates the RegEx expression even more, but I think that someone can come up with something to help you.
Also, you will have to make sure that you are ONLY placing the tags at the end of the line. If you add any other text at the end of the line, the RegEx will fail. Hope this helps.