how to swap words in multi-rename

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

how to swap words in multi-rename

#1 Post by ZX » 29.09.2009, 04: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: 52
Joined: 01.04.2013, 21:24

Re: how to swap words in multi-rename

#2 Post by kino » 02.04.2015, 13: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: 1346
Joined: 22.07.2009, 19:19
Location: Romania
Contact:

Re: how to swap words in multi-rename

#3 Post by joby_toss » 02.04.2015, 18: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: 52
Joined: 01.04.2013, 21:24

Re: how to swap words in multi-rename

#4 Post by kino » 03.04.2015, 14: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, 16:22

Re: how to swap words in multi-rename

#5 Post by jackpots » 28.04.2015, 16: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: 52
Joined: 01.04.2013, 21:24

Re: how to swap words in multi-rename

#6 Post by kino » 30.04.2015, 08: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 1 guest