Not sure if this a bug or just me overlooking something, but my apologies in advance if it’s the latter. I’ve only started trying to use regular expressions in various programs about three months ago or so, and only a week or two ago in MP3Tag specifically, so I’m not by any means a Regex expert, or an MP3Tag scripting expert.
I’ve been using what seems to me like pretty straightforward and simple Regex code recently to append text and/or numbers to existing data in fields. For example, I’ve used the following sequence of actions and code to append to the COMMENT field:
Actions > Actions (Quick)
Replace with regular expressions
…that many others are using “$1” instead of “\1” to represent the matched string in the replacement expression. I was only familiar with “\1” from my Regex use in other programs (Notepad++, Directory Opus), but tried it both ways in MP3Tag, and got the same results either way.
Although I can also see this behaviour, the best way to append strings to an existing field contents would be an action of the type "Format value" and the
Format string %fieldname% append string
The problematic result looks like as if there are multiple regex matches in any way.
You can modify the input of the action "Replace with regular expression" this way:
Field: COMMENT
Regular Expression: .+
replace matches with: $0 testing
Both of your suggestions work — thank you, and thanks also to ohrenkino for suggesting I use Format Value — but I still don’t get why my original method results in two of the appended string. Multiple regex matches? Huh? I just tried my method again as follows:
5 MP3 files with comment “This is”
5 FLAC files with comment “There will be”