RegExp in multiline field


#1

RegExp in multiline field

When using Mp3tag's regexp functionality how can it be realized to remove trailing CRLF sequence in a multi-line tag field without touching any other CRLF sequences in the text stream?

Symbolic text stream in multi-line field:
CRLFCRLFCRLF

Only the trailing CRLF sequence in the above example should be removed to become:
CRLFCRLF.

See following actionsgroup as an example:

Begin Actionsgroup TEST

Action #1
Actiontype 5: Format tag field
Field: TEST_1
Formatstring: ***$char(13)$char(10)$char(13)$char(10)***$char(13)$char(10)

Action #2
Actiontype 5: Format tag field
Field: TEST_2
Formatstring: $regexp(%TEST_1%,\r\n$,)

Action #3
Actiontype 5: Format tag field
Field: TEST_3
Formatstring: %TEST_1%

Action #4
Actiontype 4: Replace with regular expression
Field: TEST_3
Regular expression: \r\n$
Replace matches with:

[_] case sensitive comparison

End Actionsgroup TEST (4 Actions)

Action #2 and #4 give the same result value:
***$char(13)$char(10)***

It should be:
***$char(13)$char(10)$char(13)$char(10)***

But how?

DD.20080609.1740.CEST


#2

Well, I got it for myself:
$regexp(***$char(13)$char(10)$char(13)$char(10)***$char(13)$char(10),\r\n\Z,)
gives
$char(13)$char(10)$char(13)$char(10)

DD.20080609.2022.CEST