Page 1 of 1

Small glitch in Rename Special->RegEx rename?

Posted: 12 Dec 2012 13:18
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

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

Posted: 12 Dec 2012 13:58
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

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

Posted: 13 Dec 2012 09:18
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