# RegExp in multiline field

**URL:** https://community.mp3tag.de/t/regexp-in-multiline-field/6928
**Category:** Support
**Created:** [June 9, 2008, 1:41pm UTC](https://community.mp3tag.de/t/regexp-in-multiline-field/6928 "2008-06-09T13:41:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 9, 2008, 1:41pm UTC](https://community.mp3tag.de/t/regexp-in-multiline-field/6928/1 "2008-06-09T13:41:24Z")

</div>

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:  
_ **CRLFCRLF** CRLF_

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

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 9, 2008, 4:22pm UTC](https://community.mp3tag.de/t/regexp-in-multiline-field/6928/2 "2008-06-09T16:22:24Z")

</div>

> [@DetlevD](#):
>
> ... It should be:  
> _**$char(13)$char(10)$char(13)$char(10)**_

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

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:21pm UTC](https://community.mp3tag.de/t/regexp-in-multiline-field/6928/3 "2026-02-09T12:21:00Z")

</div>


