how to swap words in multi-rename

Discussion, questions and support.
Post Reply
Message
Author
ZX
Posts: 1
Joined: 29.09.2009, 05:34

how to swap words in multi-rename

#1 Post by ZX » 29.09.2009, 06:08

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

kino
Posts: 123
Joined: 01.04.2013, 23:24

Re: how to swap words in multi-rename

#2 Post by kino » 02.04.2015, 15:10

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

joby_toss
Posts: 1345
Joined: 22.07.2009, 21:19
Location: Romania
Contact:

Re: how to swap words in multi-rename

#3 Post by joby_toss » 02.04.2015, 20:04

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? :)

kino
Posts: 123
Joined: 01.04.2013, 23:24

Re: how to swap words in multi-rename

#4 Post by kino » 03.04.2015, 16:36

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)

jackpots
Posts: 5
Joined: 28.04.2015, 18:22

Re: how to swap words in multi-rename

#5 Post by jackpots » 28.04.2015, 18:36

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.

kino
Posts: 123
Joined: 01.04.2013, 23:24

Re: how to swap words in multi-rename

#6 Post by kino » 30.04.2015, 10:04

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 !

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests