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 <csanyi...@gmail.com> wrote:
> Leo Susanto <leosusa...@gmail.com> writes:
>
>> On Mon, Oct 17, 2011 at 11:46 AM, Csanyi Pal <csanyi...@gmail.com> 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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to