- or download this
$ perl -Mstrict -Mwarnings -E '
my $interface = q{bge12};
$interface =~ s{[0-9]$}{:$&};
say $interface;'
bge1:2
$
- or download this
$ perl -Mstrict -Mwarnings -E '
my $interface = q{bge12};
$interface =~ s{(?=\d+$)}{:};
say $interface;'
bge:12
$