dir | ?{$_ -match '^(.*?)(\d+)(\.[^.]*)?$'} | %{ ren $Matches[0] ("{0}{1:000}{2}" -f $Matches[1], [int]$Matches[2], $Matches[3]) }
Standard input is empty
Standard output is empty
./prog.sh: line 1: syntax error near unexpected token `(' ./prog.sh: line 1: `dir | ?{$_ -match '^(.*?)(\d+)(\.[^.]*)?$'} | %{ ren $Matches[0] ("{0}{1:000}{2}" -f $Matches[1], [int]$Matches[2], $Matches[3]) }'