Page 1 of 1

how to swap words in multi-rename

Posted: 29.09.2009, 04:08
by ZX
regex equivalent would (roughly) be:

(\w+)\s(\w+)\s(\w+).foo --> \1 \3 \2.foo

Example:

HBR October 2007.pdf -> HBR 2007 October.pdf
HBR April 2008.pdf -> HBR 2008 April.pdf
HBR January 2008.pdf -> HBR 2009 January.pdf

Re: how to swap words in multi-rename

Posted: 02.04.2015, 13:10
by kino
Hello ZX,

I like your example so I tried it as is (slight change on extension from "foo" to "pdf")

It just doesn't work in multirename search and replace regex boxes (as of b689)

Does FC actually offer regex catpuring groups and back references ? (with \1...\n or whatsoever)

Can you provide an actually working example ?

Thanks

Re: how to swap words in multi-rename

Posted: 02.04.2015, 18:04
by joby_toss
It's been 6 years since his first and last post, do you really think he's still around? And still using the old FC version? :)

Re: how to swap words in multi-rename

Posted: 03.04.2015, 14:36
by kino
Hello,
I actually noticed but I was willing to bump on an elaborated example rather than to start a brand new thread.
Even if ZX is now an ol' granpa' (like the rest of us by now), I wish he/she still has most of his mind and switched to FC XE (b689 hopefully)
...but everyone is welcome to reply !
so, what about back-referencing capturing groups in multirename regex replacement ?
(thanks)

Re: how to swap words in multi-rename

Posted: 28.04.2015, 16:36
by jackpots
kino wrote:Hello,

... so, what about back-referencing capturing groups in multirename regex replacement ?
(thanks)
Depending on the flavor of Regex, the captured groups are referenced as \1 \2 etc., or $1 $2 etc. for the replace string.
FC XE appears to use the latter.

Re: how to swap words in multi-rename

Posted: 30.04.2015, 08:04
by kino
That's it !
FC XE uses Perl-style capturing groups back referencing (e.g. : $1) vs. Java-style (e.g. : \1)
Can't seem to find it in the fine manual though.
Anyway, THANK YOU !