# help removing a string nd the characters at each end

**URL:** https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218
**Category:** Support
**Created:** [December 11, 2012, 11:00pm UTC](https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218 "2012-12-11T23:00:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![officerbill](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/o/db5fbb/32.png) [@officerbill](https://community.mp3tag.de/u/officerbill)
#### Post date: [December 11, 2012, 11:00pm UTC](https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218/1 "2012-12-11T23:00:27Z")

</div>

I've read through all of the forum topics related to removing strings as well as the FAQ's. The only thing similar to what I need has to do with removing parentheses and what is contained within them. I've tried variations on that, but I can't get them to work.

I have about 300 songs where the ARTIST is something like this:  
Singer --some words-- --some more words-- --maybe some random characters--

The characters between the -- are different for each artist. How can I remove the -- and everything between them?

Thanks in advance

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [December 12, 2012, 12:33am UTC](https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218/2 "2012-12-12T00:33:32Z")

</div>

> [@W Fred](#):
>
> I have about 300 songs where the ARTIST is something like this:  
> Singer --some words-- --some more words-- --maybe some random characters--

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **ARTIST** _Formatstring:_ **$regexp(%artist%,'^([^-]+)\s+--.\*','$1')**

End Action Group **\_Script Test#TEST** (1 Action)

See screenshot of how the regexp works.

 ![](https://community.mp3tag.de/uploads/default/original/2X/3/3fc059209bd2a593c2c9a879de099f8b2e2d87f7.jpg)  

 ![](https://community.mp3tag.de/uploads/default/original/2X/3/3fc059209bd2a593c2c9a879de099f8b2e2d87f7.jpg)

---

<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: [December 12, 2012, 5:48am UTC](https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218/3 "2012-12-12T05:48:43Z")

</div>

> [@W Fred](#):
>
> ... I have about 300 songs where the ARTIST is something like this:  
> Singer --some words-- --some more words-- --maybe some random characters--  
> The characters between the -- are different for each artist. How can I remove the -- and everything between them? Thanks in advance

Converter: Tag -Tag  
Field: ARTIST  
Format string:

**$left(%ARTIST%,$sub($strstr(%ARTIST%,' --'),1))**

... or ...

**$regexp(%ARTIST%,'^(.+?)(\s--.+--)+$','$1')**

... or ...

**$regexp(%ARTIST%,'\s--.+?--',)**

From:  
Singer --some words-- --some more words-- --maybe some random characters--  
To:  
Singer

DD.20121212.0745.CET

---

<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:24pm UTC](https://community.mp3tag.de/t/help-removing-a-string-nd-the-characters-at-each-end/14218/4 "2026-02-09T12:24:13Z")

</div>


