The regex below uses two positive lookaheads and a positive lookbehind to split the string at the desired locations without consuming any characters. The map at the end breaks the result up into a list containing each @name and its associated strings.
Would it be any way to modify the code you proposed to make it work on these cases? I'm not thinking of a general code that would work for x and x1, but I'm thinking in an adaptation of your xs just for the cases of x1
@joels your help in the last comment has been very useful