I have a string like s = '{qcos\\theta_{g}\\over r})^{2\\over 1 + \\alpha^{2}}}\\ 1234'
and if I use the regex (?<=.)(?!$) as I have used in this example, it gives me the whole string split in white characters. But I want to preserve anything \wordonly so for example in the above given string, I want the answer to be
'{ q c o s \\theta _ { g } \\over r } ) ^ { 2 \\over 1 + \\alpha ^ { 2 } } } \\ 1 2 3 4'
where \theta remains the same but 123 becomes 1 2 3, abc becomes a b c and \theta_{21} becomes \theta _ { 2 1 }