Given the following list or tuple:
list: [UURRUULLLRRDDDBBBUUU]
Step 1: Count how many times an "U" character repeats before a new "unknown2 (R or D or B or L?)" character appears and records (number of repetitions + letter of the respective "U" character)
Step2: Continued from Step 1: Count how many times the "unknown2" character repeats until a new character other than "unknown2" appears. or equal to the "U" character and record (number of repetitions + letter of the respective "unknown2" character).
Intermediate Step: If the new character after the "unknown2" character equals the "U" character count how many times it repeats in this new occurrence and repeat Step1.
That is, for the tuple (list) the result of the organized repetitions of the way I want is:
2U2R2U3L2R3D3B3U
Something similar would be This (but not in regex) besides the result is not the same but it is a start for me.