in reply to Renaming an image file
ors/^([^_]+_).*(\.\w{3})\z/$1 . sprintf("%08d", rand(100000000)) . $2/eg +;
or (5.10 required)s/^([^_]+_).*(?=\.\w{3}\z)/$1 . sprintf("%08d", rand(100000000))/eg;
s/^[^_]+_\K.*(?=\.\w{3}\z)/sprintf("%08d", rand(100000000))/eg;
This way the files will be unique and uniform for my storage needs.
Random numbers aren't unique. They're random.
|
|---|