# Remove part of Tag

**URL:** https://community.mp3tag.de/t/remove-part-of-tag/4462
**Category:** Support
**Created:** [February 12, 2007, 7:20am UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462 "2007-02-12T07:20:13Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![KaraokeK](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@KaraokeK](https://community.mp3tag.de/u/KaraokeK)
#### Post date: [February 12, 2007, 7:20am UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/1 "2007-02-12T07:20:13Z")

</div>

Having searched the forums I thought I’d worked this out – didn’t, haven't – messed up.

Have title tag for example  
“Happy Birthday, Sweet Sixteen - Neil Sedaka”  
Want to remove “ - Neil Sedaka”

Created action  
Field = Title  
Regular Expression = (._)-(._)  
Replace matches with = $trim($1)

Using this action title is renamed  
“Happy Birthday”

Seems to work OK if there is no “, “ in title  
i.e. “Happy Birthday Sweet Sixteen - Neil Sedaka”  
Returns “Happy Birthday Sweet Sixteen”

Need to be shown the error of my ways – big please

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [February 12, 2007, 11:42am UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/2 "2007-02-12T11:42:40Z")

</div>

There's currently a problem when a comma enters a function in the RegEx Action.

But you can just use a different expression that has the same effect, like  
RE: \s+-.+$  
Replace:

---

<div class="post-metadata">

### Author: ![KaraokeK](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/eada6e/32.png) [@KaraokeK](https://community.mp3tag.de/u/KaraokeK)
#### Post date: [February 12, 2007, 2:51pm UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/3 "2007-02-12T14:51:34Z")

</div>

Thanks for that.

Luckily didn't mess up too many. This should mean that I don't mess up any more.

Cheers

---

<div class="post-metadata">

### Author: ![bigdaddy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bigdaddy](https://community.mp3tag.de/u/bigdaddy)
#### Post date: [February 13, 2007, 2:15pm UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/4 "2007-02-13T14:15:52Z")

</div>

> [@dano](#):
>
> But you can just use a different expression that has the same effect, like  
> RE: \s+-.+$  
> Replace:

Man, I am really trying to understand this. I am trying to trim the last 7 characters from my album field. I have been using a regular expression to trim the first three characters of the title like so:

Field = Title  
Regular Expression = ^.{3}  
Replace matches with = ""

Very simple and straight forward. I thought that it would be just as simple to do the last 7 (not trailing spaces " [YYYY]" with $.{7} . This obviously is not working. I am not good at scripting, I have been reding the forum for about an hours and I am just not getting it.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [February 13, 2007, 2:55pm UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/5 "2007-02-13T14:55:10Z")

</div>

You could have seen from my post that the end sign $ is also acutally put at the end!  
.{7}$

---

<div class="post-metadata">

### Author: ![bigdaddy](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/a4c791/32.png) [@bigdaddy](https://community.mp3tag.de/u/bigdaddy)
#### Post date: [February 13, 2007, 4:57pm UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/6 "2007-02-13T16:57:00Z")

</div>

Damn I hate it when it is something simple like that. Thanks for the help.

---

<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:20pm UTC](https://community.mp3tag.de/t/remove-part-of-tag/4462/7 "2026-02-09T12:20:09Z")

</div>


