- or download this
s/^([^_]+_).*(\.\w{3})\z/$1 . sprintf("%08d", rand(100000000)) . $2/eg
+;
- or download this
s/^([^_]+_).*(?=\.\w{3}\z)/$1 . sprintf("%08d", rand(100000000))/eg;
- or download this
s/^[^_]+_\K.*(?=\.\w{3}\z)/sprintf("%08d", rand(100000000))/eg;