in reply to Regex to replace consecutive tokens
$s =~ s/,\B/,0/g; [download]
Update. Here's a rx that handles leading and trailing commas, empty strings:
$s =~ s/(^|,)\K(?![^,])/0/g; [download]