In this string:
#animal the cat #tree palm tree
I want to match
#animal
the cat
and
#tree
palm tree
I have found several ways to match the first one but I have problems stopping at the second # character and continue from there.
(?<=#)(\w*)\s(.*)(?!#)
finds only one match capturing everything after #animal until the end.
Lazyfiying the capturer next to the tag captures the tags
(?<=#)(\w*)\s(.*?)(?!#)
What am I missing?