# Need help with regex to swap contents

**URL:** https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611
**Category:** Support
**Created:** [August 15, 2024, 2:49am UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611 "2024-08-15T02:49:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [August 15, 2024, 2:49am UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611/1 "2024-08-15T02:49:26Z")

</div>

Hi, I'm trying to to convert 'tag to tag'.

In the TITLE field, I have 'Artist - Track'.

I want to have the TITLE field as 'Track {Artist}'.

(I know it's unorthodox, but that's how I want 'Various Artists' compilations named.)

So... %title% {%artist%} is what I want in the format field,  
but...  
of course that gives me 'Artist - Track {artist}'

I know I can use $regexp(), but what can i put between the brackets so it ignores everything before ' - ', including the ' - '.

As long as I live, I don't think I'll ever get the hang of regex!

Would appreciate any help, thanks 🙂

---

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [August 15, 2024, 3:01am UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611/2 "2024-08-15T03:01:09Z")

</div>

never mind.... sorted.

I did: filename \> title, filtering out everything except the title.

then: tag to tag \> %title% {%artist%}

---

<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: [August 15, 2024, 5:08am UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611/3 "2024-08-15T05:08:09Z")

</div>

> [@AudioBabble](#):
>
> I have 'Artist - Track'.

The regular expression would have been:  
`$regexp(%title%,(.*) - (.*),$2 {$1})`

---

<div class="post-metadata">

### Author: ![AudioBabble](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/41988e/32.png) [@AudioBabble](https://community.mp3tag.de/u/AudioBabble)
#### Post date: [August 15, 2024, 1:42pm UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611/4 "2024-08-15T13:42:34Z")

</div>

Thank you -- I'll have to give that a try next time I encounter this situation.  
Actually, staring at it a while, the regex makes sense -- maybe there's hope for me yet!

---

<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: [September 14, 2024, 1:42pm UTC](https://community.mp3tag.de/t/need-help-with-regex-to-swap-contents/65611/5 "2024-09-14T13:42:41Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
