Small glitch in Rename Special->RegEx rename?

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
JoTo
Posts: 23
Joined: 18 Oct 2007 12:08

Small glitch in Rename Special->RegEx rename?

Post by JoTo »

Using: XyPlorer Pro V 11.80.0103 under Win7 Pro x64

Hi Donald and XyUsers,

i just stumbled upon an effect i consider a small bug (but not sure if it is my failure).

I tried to rename a bunch of files with a regex rename. I wanted to insert a part of the source filename into parenthis. E.g.

"My Holiday - In Australia.doc" -> "My Holiday (In Australia).doc"

I tried the following regex rename pattern: " - In (.+) > (In $1)"

This worked fine, except that the last (closing) parenthis was not inserted in the resulting filename. All other parts of the filename were exactly what i wanted though. Just the last parenthis was missing.

So the result of the a.m. operation was like this:

"My Holiday - In Australia.doc" -> "My Holiday (In Australia.doc"

So i tried to do a workaround with this regex pattern: - In (.+).doc > (In $1).doc

And voila! The closing parenthis was there now. So i solved my renaming problem to exactly what i needed and wanted. But it looks strange to me, that the first pattern sends the closing parenthis to nirvana or wherever. :)

I also tried to escape the parenthis with \( and \). But that resulted in an invalid result filename (inserting literally \( and \) into the resulting filename). So i learned that i dont have to escape special characters on the right side of the regex operator. CHECK! NOTED! LEARNED! :)

So i wonder: Is this "no no closing parenthis at the end if you dont append the file extension" behaviour by design (of Xy and/or RegEx engine) and so definitely my failure or is this maybe a glitch in the regex rename functionality?

Would be happy to get a short response that clarifies it for me.

Thank you in advance.

Greetings
JoTo

admin
Site Admin
Posts: 65064
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Small glitch in Rename Special->RegEx rename?

Post by admin »

No parenthesis is lost here on my system:

Pattern: - In (.+) > (In $1)
Input: My Holiday - In Australia.doc
Output: My Holiday(In Australia.doc)

Pattern: - In (.+).doc > (In $1).doc
Input: My Holiday - In Australia.doc
Output: My Holiday(In Australia).doc

JoTo
Posts: 23
Joined: 18 Oct 2007 12:08

Re: Small glitch in Rename Special->RegEx rename?

Post by JoTo »

Now it works for me too! :veryconfused:

Strange, very strange! Wonderful self-healing feature in Xy! :)

Sorry for the noise. *sigh*

Thanks anyway for your effort and kind testing. Close this topic as resolved!

Greetings
JoTo

Post Reply