Multi-Rename RegEx problems?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
bobbozzo
Junior Member
Junior Member
Posts: 11
Joined: 2011-01-19, 07:45 UTC

Multi-Rename RegEx problems?

Post by *bobbozzo »

Hi,
In 9.21a and 9.22a (64-bit), I'm having trouble with RegEx in the Multi-Rename tool... trying to append or prepend a string to the filename doesn't seem to be working like it used to...
for a file named 12345678.jpg
Search for: ($1)
Replace with: AAAA - $1 - BBBB
Extension UNChecked

should result in
AAAA - 12345678 - BBBB.jpg
but instead gets
AAAA - 12345678 - BBBBAAAA - - BBBB.jpg

I'll try to upload a screenshot.

Thanks
User avatar
Stefan2
Power Member
Power Member
Posts: 4133
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Multi-Rename RegEx problems?

Post by *Stefan2 »

bobbozzo wrote: 2019-08-13, 05:36 UTC Hi,
In 9.21a and 9.22a (64-bit), I'm having trouble with RegEx in the Multi-Rename tool... trying to append or prepend a string to the filename doesn't seem to be working like it used to...
for a file named 12345678.jpg
Search for: ($1)
Replace with: AAAA - $1 - BBBB
Extension UNChecked

should result in
AAAA - 12345678 - BBBB.jpg
but instead gets
AAAA - 12345678 - BBBBAAAA - - BBBB.jpg

I'll try to upload a screenshot.

Thanks

>>> Search for: ($1)
That $1 is a regex-marker for the replacement box
for to reuse what was captured in the Search by the first capturing group (...)

So adjust your search and tell the regex engine what you are looking for between your capturing parenthesis (...)
Your replacement looks fine, however.



Need any more help? ...



 
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Multi-Rename RegEx problems?

Post by *Dalai »

Uh, to enclose a filename (i.e. to prepend and append something) RegEx is not needed at all. Just use the Rename mask box and add your additional strings there, before the [N] and after it.

However, I can confirm the issue itself, even in TC 8.52a. I don't know why it occurs, but it can be solved by ticking [X] Subst checkbox.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
bobbozzo
Junior Member
Junior Member
Posts: 11
Joined: 2011-01-19, 07:45 UTC

Re: Multi-Rename RegEx problems?

Post by *bobbozzo »

Stefan2 wrote: 2019-08-13, 07:51 UTC >>> Search for: ($1)
That $1 is a regex-marker for the replacement box
for to reuse what was captured in the Search by the first capturing group (...)
Sorry, you're right, I was doing it completely wrong!

This bug report can be closed.

thanks!
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Re: Multi-Rename RegEx problems?

Post by *HolgerK »

Dalai wrote:However, I can confirm the issue itself, even in TC 8.52a. I don't know why it occurs, but it can be solved by ticking [X] Subst checkbox.
bobbozzo wrote: Search for: ($1)
Replace with: AAAA - $1 - BBBB
...
should result in
AAAA - 12345678 - BBBB.jpg
but instead gets
AAAA - 12345678 - BBBBAAAA - - BBBB.jpg
Shouldn't this topic stay under bug reports, because even with the correct search mask (.*) the resulting name looks quite strange if 1x is unchecked?

Regards
Holger
Make our planet great again
Post Reply