79631784

Date: 2025-05-21 10:25:59
Score: 1.5
Natty:
Report link

What if we extract all digit sequences first?

@n=($s=~/\d+/g)

Then, replace only the last two with zero-padded versions

$i++ < @n - 2 ? $& : sprintf(...)

So, something like

perl -E '$s="abc-2de3-fg44-55.jpg"; @n=($s=~/\d+/g); $i=0; $s=~s/\d+/$i++ < @n - 2 ? $& : sprintf("%03d", $&)/ge; say $s'
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): What if we
  • Low reputation (0.5):
Posted by: Pavan Bhatt