Batch Rename with RegEx Substitutions and Flags

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

Post Reply
kweso
Posts: 6
Joined: Tue Nov 26, 2013 11:28 am

Batch Rename with RegEx Substitutions and Flags

Post by kweso »

Hey,
i have filenames like "Some_Projectname 23.YYYYMMDDCxyz.C12v08.final_new.psd".

All i need from this is the project name and the Chapter and Version (C12v08) -part of it. So i tried RexEx search.
I did:
([a-zA-Z\s_-]+)(.)*(c[0-9]+v[0-9]+)(.)*

First problem: since the chapter "C" and version "V" cases are not consistent. So I need \i. How do i set flags in xnviews renamer? (BTW: the checkbox for case in the UI does not help).

Second problem:
I tried "$1_$3.psd" but the $x's are not interpreted.

Thanks for any hint,
kws
User avatar
xnview
Author of XnView
Posts: 43598
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Batch Rename with RegEx Substitutions and Flags

Post by xnview »

i use this and \i is not supported directly
Pierre.
surfalot
Posts: 1
Joined: Tue Dec 08, 2020 11:52 pm

Re: Batch Rename with RegEx Substitutions and Flags

Post by surfalot »

I'm having the same problem as the OP's second issue above.
I understand RegEx. The QRegExp Class you refer to infers we can use

Code: Select all

$1
to reuse captured text in the replace field. It's a normal thing.
1) did you implement the capture functions?
2) is it supposed to still be

Code: Select all

$1, $2, $3
, etc.?
Of course the reason I'm asking is most likely the same as @kweso, it is not working.
Please impart me some info on this topic.
Post Reply