[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gcmd-usr] Regex replacing in Advanced Rename Tool
From: |
joe |
Subject: |
Re: [gcmd-usr] Regex replacing in Advanced Rename Tool |
Date: |
Tue, 03 Apr 2007 09:26:08 +0200 |
On Mon, 2007-04-02 at 23:36 +0200, Piotr Eljasiak wrote:
> You think about something like:
>
> Replace this: ^([a-zA-Z]+)([1-9][0-9]*)
> With this: \2\1
>
> right?
>
> Unfortunately it is not possible yet... I'll add this to our TODO list,
> but it won't get into gcmd before 1.2.5
That's exactly what I meant. Thanks for adding it to your list.
> But... there is a workaround for your problem:
>
> 1. file extension is accessible in template as $e
> 2. If you know the number of digits in advance, you can use
> python-like ranges in templates, e.g. $n(0:-1) will bring you
> all characters till the last one in the filename.
>
> So in your example use template (but not regex!!!):
>
> $n(-1:)$n(:-1).$e
>
> to get 4foo.bar
Thanks a lot, that did the job! Still looking forward to the next
releases.
Regards,
Joe