in reply to Re^2: Regex to replace consecutive tokens
in thread Regex to replace consecutive tokens

Easy to fix:
my $t = '1,2,3,,5,6,,,9,10,,,,14,15,,,,,,,,,,,,,,,'; my $s = join ',' => map { $_ ne '' ? $_ : '0' } split /,/ => $t, 1 + $t =~ y/,//;

Update: Or, maybe a bit more readable

my $s = join ',' => map $_ || 0, split /,/ => $t, 1 + $t =~ y/,//;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ