'Replace with regular expression' action deletes dollar ($) symbols

bug-fixed

#1

If an input field has multiple consecutive $ symbols and a 'Replace with regular expression' action is performed on the field, one or more of the $ symbols is removed.

In the following example, the title field is filled with ten incrementally increasing sets of dollar signs, followed by an integer representing the number of $ symbols that directly precedes it.

Input:
$1 $$2 $$$3 $$$$4 $$$$$5 $$$$$$6 $$$$$$$7 $$$$$$$$8 $$$$$$$$$9 $$$$$$$$$$10

Output:
$1 $2 $$3 $$4 $$$5 $$$6 $$$$7 $$$$8 $$$$$9 $$$$$10


#2

Could you show the syntax of your regular expression that caused this effect?
I suspect that the alleged bug could be completely regular behaviour for a regular expression...


#3

Try it yourself, it seems that any regular expression has the same effect. FWIW, here is the one I used for the above example.

Action type: Replace with regular expression
Field: TITLE
Regular expression: (.*)
Replace matches with: $0
[ ] case-sensitive comparison


#4

I did that and found the same result as you did.
I am still wondering: what would be the purpose of an action that looks for any string and replaces it with itself (that is how I read the replace action)


#5

Actually, that was an ad hoc action used specifically for testing the bug. It has no other purpose.


#6

Please tell us what would be the correct result you do expect.

DD.20110630.1305.CEST


#7

Isn't it obvious? A track with the title "Bitches & $$$", for instance, would be formatted to "Bitches & $", implying that Brown Hood now only has a single dollar, though to his credit he has retained all his bitches.

Of course, the "correct result" should be that nothing is arbitrarily removed without the operator's explicit instruction. It's clearly a bug.

EDIT: the above example would occur if using an action with more than one 'replace with regex' scripts, which for me is often the case.


#8

Hmm, not so obvious at all, because you never said, that your input-output example is even valid when using the $1 referrer, given by the round brackets, and you never said, that the input string as the whole match should be reflected without change when using the $0 referrer.

As a workaround you can use an action "Format value" in combination with the function $regexp(). This should work as it should be.

DD.20110630.1424.CEST


#9

Actually, I clearly stated from the beginning that any replace /w regex action, regardless of syntax or referrers used, will have the same result. As for your workaround, while that is useful to know, it does not fulfill the objective of this forum: namely, to get bugs in the software fixed.


#10

???.
There are many actions of type "Replace using Regular Expression" in my regular set of actions and all do what they should do.

Yes, you are right.
Hopefully this come to attention again.

DD.20110630.1753.CEST


#11

This is now fixed with Mp3tag v2.90e.