Broken rename function

Following code does not work anymore in the current version:

Rename MATCHCASE REGEXP PATTERN="(.*)(^| )(The)($| |\.)(.*)#" TO="\1\2the\4\5"

I might add: this function is supposed to replace all "The" with lower case "the". What happens? An error occurs after the first rename attempt, saying "file already exists"
(which is strange), then the first file gets renamed as "the", with no extension (That would be track no.1 in the list). That button used to work for years. :open_mouth:

I'm guessing to fix the runaway .* that seemed to cause crashes recently the greedy option was changed to non-greedy, thus your .* are acting like .*? instead. I can replicate the same result in an older DOpus by using your expression above and changing .* into the non-greedy variant .*?.

... and by the way, that expression seem awfully convoluted. Once the bug gets fixed, try instead:

Old name: (.)\bThe\b(.)#
New name: \1the\2

Devs - the same behavior as reported in this bug is shown via this simpler expression. The return is simply "the".

I don't think anything has changed with RegEx support in a long time.

If you change the regex style back to the legacy Opus 9 version (via Prefs / Miscellaneous / Advanced / regex_style) the replace works so I suspect this is just a difference of TR1/ECMAScript and that you haven't actually used this function since Opus 10 was released (i.e. in about 2 years).

Hm. i´m quite sure i´ve used that code many times in a period shorter that 2 years (like, couple of months ago), & it always did what it should, no error. That´s strange.

[quote="MrC"]try instead:

Old name: (.)\bThe\b(.)#
New name: \1the\2[/quote]

Rename MATCHCASE REGEXP PATTERN="(.*)\bThe\b(.*)#" TO="\1the\2"

Does nothing :cry:

[quote="jon"]I don't think anything has changed with RegEx support in a long time.

If you change the regex style back to the legacy Opus 9 version (via Prefs / Miscellaneous / Advanced / regex_style) the replace works so I suspect this is just a difference of TR1/ECMAScript and that you haven't actually used this function since Opus 10 was released (i.e. in about 2 years).[/quote]

Take a look at the two screenshots comparing 10.5.0.0 vs. 10.5.0.2. Both DOpus versions are using TR1 style regex.



Using the rename UI works fine for me, but using the command..

>Rename MATCHCASE PATTERN="(.)\bThe\b(.)#" TO="\1the\2" REGEXP

changes Dance With The Devil.txt to the

The command syntax looks OK to me, but then I have been known to be wrong before... :laughing:

Regards, AB

Ok thanks for that, I've tracked it down to a change in the last beta that broke case-sensitive regex renaming. Will be fixed in 10.5.0.3.

Confirm fixed w/10.5.0.3 (4808).