My sample string:
a ghgduysgd a fdferfdf a bvfxbgdf a gdfgdfg
You alrady use a lookbehind in your regex, change it to also use a lookahead:
Then make the
.* non-greedy to stop at the first available "ending"
a|$ is from tobias_k's comment below, originally it was just