# RegEx to Remove Dash

**URL:** <https://community.mp3tag.de/t/regex-to-remove-dash/15996>\
**Category:** Support\
**Created:** [August 13, 2014, 8:52am UTC](https://community.mp3tag.de/t/regex-to-remove-dash/15996 "2014-08-13T08:52:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [August 13, 2014, 8:52am UTC](https://community.mp3tag.de/t/regex-to-remove-dash/15996/1 "2014-08-13T08:52:15Z")

</div>

I have the following strings a wish to remove the dash from the 1st example but not the second

Could somebody please help me

Bob Marley -  
Bob Marley - The King of Reggae

**Result**  
Bob Marley  
Bob Marley - The King of Reggae

---

<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:** [August 13, 2014, 8:55am UTC](https://community.mp3tag.de/t/regex-to-remove-dash/15996/2 "2014-08-13T08:55:31Z")

</div>

Use the function: $trimRight

DD.20140813.1255.CEST

---

<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 13, 2014, 9:27am UTC](https://community.mp3tag.de/t/regex-to-remove-dash/15996/3 "2014-08-13T09:27:49Z")

</div>

> [@Dego](#):
>
> I have the following strings a wish to remove the dash from the 1st example but not the second
> 
> Could somebody please help me
> 
> Bob Marley -  
> Bob Marley - The King of Reggae
> 
> **Result**  
> Bob Marley  
> Bob Marley - The King of Reggae

Use an action of the type "Replace with regular expression"  
Enter as search string: " -$"  
(leave out the " - I needed them to show the blank)  
leave Replace string empty.

---

<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:25pm UTC](https://community.mp3tag.de/t/regex-to-remove-dash/15996/4 "2026-02-09T12:25:11Z")

</div>

Closed on February 9, 2026, 12:25pm UTC


