$string =~ s/(?<=1)(0+)(?=1)/'1' x length($1)/eg; [download]
In reply to Re: Creating a fill-in regexp by CombatSquirrel in thread Creating a fill-in regexp by jpfarmer