# Formatting - medley

**URL:** <https://community.mp3tag.de/t/formatting-medley/72083>\
**Category:** Support\
**Created:** [November 16, 2026, 11:03am UTC](https://community.mp3tag.de/t/formatting-medley/72083 "2026-11-16T11:03:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![KEEBLER](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@KEEBLER](https://community.mp3tag.de/u/KEEBLER)\
**Post date:** [November 16, 2026, 11:03am UTC](https://community.mp3tag.de/t/formatting-medley/72083/1 "2026-11-16T11:03:38Z")

</div>

so i have multiple titles that are "medleys" (by description). I would like to reformat these.

some titles have song 1/song 2/song 3 (etc) followed by (medley)

focusing on this one first

i would like to have it formatted like this (if possible)

[Medley] song 1, song 2, song 3, (etc)

note: removing the "/" and moving and reformatting the medley

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 16, 2026, 11:23am UTC](https://community.mp3tag.de/t/formatting-medley/72083/2 "2026-11-16T11:23:59Z")

</div>

You would like to move the word **(medley)** from the end of `TITLE` to the beginning, put it in square brackets `[Medley]`, write the first letter uppercase and replace the `/` separators with commas and space?

Do you first filter manually for tracks with **(medley)** at the end?

---

<div class="post-metadata">

**Author:** ![KEEBLER](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@KEEBLER](https://community.mp3tag.de/u/KEEBLER)\
**Post date:** [November 16, 2026, 11:26am UTC](https://community.mp3tag.de/t/formatting-medley/72083/3 "2026-11-16T11:26:14Z")

</div>

yes that is correct

no, they are scattered in the collection [nothing saying that i couldn't, i guess. just had not thought about that]

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 16, 2026, 11:41am UTC](https://community.mp3tag.de/t/formatting-medley/72083/4 "2026-11-16T11:41:30Z")

</div>

I would solve that in 3 steps:

1. First filter for tracks with (medley) in its TITLE, for example with:  
`title MATCHES "\(medley\)$"`

2. Move the word **(medley)** from the end and format the word at first position  
Convert: Tag - Tag  
`$regexp(%TITLE%,'(?i)^(.*)\s*\(medley\)$','[Medley]' $1)`  

3. Replace the slashes with comma space:  
Convert: Tag - Tag  
`$regexp(%TITLE%,'/',', ')`  

Personally, I prefer the Convert Tag-Tag option because I can see and check the result before making any changes.

Please test it carefully, as regular expressions count any character (including spaces).

---

<div class="post-metadata">

**Author:** ![KEEBLER](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@KEEBLER](https://community.mp3tag.de/u/KEEBLER)\
**Post date:** [November 16, 2026, 12:23pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/5 "2026-11-16T12:23:49Z")

</div>

can you please explain the filter variables ex: $ and your use and placement of "\"

and can steps two and three be combined?

it all worked perfectly

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 16, 2026, 12:44pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/6 "2026-11-16T12:44:50Z")

</div>

The filter command explained  
`title MATCHES "\(medley\)$"`

[MATCHES](https://docs.mp3tag.de/filter/#field-matches-regexp) is the Mp3tag filter command for a regular expression comparison.  
In this case, it looks for an **opening parenthesis** , escaped with a **backslash** = `\(`  
followed by the word **medley**  
followed by a **closing paranthesis** , escaped with a **backslash** = `\)`  
(medley) should only be matched if it is at the end of the TITLE content string = `$`

The replace of every Slash with a comma and a space using a regular expression explained:  
`$regexp(%TITLE%,'/',', ')`  
could also be simplified with  
`$regexp(%TITLE%,/,', ')`  
The meaning is:  
Replace every occurence of `/` in TITLE with a comma and a space.  
As the comma is also part of the formula, it has to be enclosed in `' '`  
For example `$regexp(%TITLE%,/,, )` would not work.

BTW:

> [@KEEBLER](#):
>
> and your use and placement of "\"

I don't replace a Backslash `\` in the above regular expression.  
As in your given example, it replaces a "forward" Slash `/` with comma and space.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 16, 2026, 2:35pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/7 "2026-11-16T14:35:18Z")

</div>

> [@KEEBLER](#):
>
> and can steps two and three be combined?

The whole procedure (except the filter) could be concatenated to:  
Format string: `$replace($regexp(%title%,(.*) \(medley\),'['Medley']' $1),/,', ')`

---

<div class="post-metadata">

**Author:** ![KEEBLER](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@KEEBLER](https://community.mp3tag.de/u/KEEBLER)\
**Post date:** [November 16, 2026, 4:48pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/8 "2026-11-16T16:48:39Z")

</div>

the backslash "\" was for the search filter query.

does the placement of the "\" bear weight on WHERE the filter looks?

I am assuming that the search filter looks for the data IN the " ";

so is it fair to assume that the "\" tells it to look at the end of the title for the (medley) phrase?

is that correct?

so omitting the "\" would cause the search filter to look anywhere in the title?

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 16, 2026, 4:57pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/9 "2026-11-16T16:57:12Z")

</div>

> [@KEEBLER](#):
>
> so omitting the "\" would cause the search filter to look anywhere in the title?

The backslash `\` in the filter is needed to escape the opening parenthesis that follows.

You can think of it as telling the filter parser:  
"Treat this `(` as a literal character, not as the beginning of a capture group or anything else."

So, the backslash `\` has nothing to do with the search position or where the matching starts.

Only the trailing `$` defines a position constraint. It means that the match is only valid if it occurs at the very end of the TITLE content string.

The opposite would be `^` at the beginning of the expression, which means that the match must start at the very beginning of the string.

You can find more detailed informations here:

> **[Regular Expressions – Mp3tag Documentation](https://docs.mp3tag.de/regex/)**
>
> Documentation on support for regular expressions in Mp3tag. Mp3tag is the universal Tag Editor.

* * *

> [@KEEBLER](#):
>
> so omitting the "\" would cause the search filter to look anywhere in the title?

If you want to match **(medley)** anywhere within `TITLE`, simply omit the trailing `$`

---

<div class="post-metadata">

**Author:** ![KEEBLER](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@KEEBLER](https://community.mp3tag.de/u/KEEBLER)\
**Post date:** [November 16, 2026, 9:53pm UTC](https://community.mp3tag.de/t/formatting-medley/72083/10 "2026-11-16T21:53:45Z")

</div>

THANK YOU!

this has been MOST helpful 🙂 ☕ 🍻

---

<div class="post-metadata">

**Author:** ![Casual\_Tea](https://community.mp3tag.de/user_avatar/community.mp3tag.de/casual_tea/32/18886_2.png) [@Casual\_Tea](https://community.mp3tag.de/u/Casual_Tea)\
**Post date:** [November 17, 2026, 1:18am UTC](https://community.mp3tag.de/t/formatting-medley/72083/11 "2026-11-17T01:18:31Z")

</div>

In case you want to avoid filtering and use a safe standard action instead.

Action type: Format value  
Field: `TITLE`  
Format string:

```auto
$if($neql($regexp(%title%,^(?=.+ \(medley\))(?!\'['Medley\']' ),'['Medley']' ,1),%title%),'['Medley']' $regexp($replace(%title%,/,', '), \(medley\),,1),%title%)

```

This only prepends `[Medley] `, removes all occurrences of `(medley)` and replaces `/` with `,` when TITLE contains ` (medley)` (case insensitive) and does not begin with `[Medley] `.
