in reply to How can I replace space sequences in a string with the number of spaces in each sequence?
This is untested code, please show some effort applying, questioning and understanding it.
Cheers Rolf
PS: Je suis Charlie!