Working with old files from DOS, I found an ancient text animation format, that specify how much time each frame must be shown in the screen. It's very simple:
F1W5F2W3
This example above indicates that Frame 1 must be shown for 5 units of time, and frame 2 for 3 units more. Now I want to convert it to:
1, 1, 1, 1, 1, 2, 2, 2
In the converted example below, frame 1 is repeated 5 times, and frame 2 three times.
Rules: The only allowed letters are F and W (and the lowercase counterparts, f and w). Numbers can go up to 255. Total input String with no more than 255 chars.
Other examples:
Input: F10W3F11W3F10W3F12W3
Output: 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 12, 12
Input: f1w0f2w10
Output: 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Short code wins.
Edited - Accepted formats: Any answer containing the output and ignoring spaces. Ex: 1, 1, 2, 2 or [1,1,2,2] or (1,1,2,2). But NOT 1 1 2 2 or [1; 1; 2; 2] or [1 1 2 2].