http://perldoc.perl.org/perlre.html

s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i

>From your requirement: PIC00001.JPG renamed as Gyermekolimpia_Ujvidek_001.jpg
1. the 3 last digits should be extracted: .+(\d{3}).jpg
2. rename everything before the 3 digits to:
'Gyermekolimpia_Ujvidek_':
s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/
3. rename 'jpg' regardless of the combination of capitalization to
simple 'jpg': s/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i


On Mon, Oct 17, 2011 at 12:07 PM, Csanyi Pal <[email protected]> wrote:
> Leo Susanto <[email protected]> writes:
>
>> On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal <[email protected]> wrote:
>>> my goal is to get in a directory the following:
>
> rename -v 's/.+(\d{3}).jpg/Gyermekolimpia_Ujvidek_$1.jpg/i' *.JPG
>
> It works perfectly. Can you explain to me how does it works?
>

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to