# Help with regex, please

**URL:** https://community.mp3tag.de/t/help-with-regex-please/3089
**Category:** Support
**Created:** [March 24, 2006, 7:44pm UTC](https://community.mp3tag.de/t/help-with-regex-please/3089 "2006-03-24T19:44:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PeterT](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/f1d935/32.png) [@PeterT](https://community.mp3tag.de/u/PeterT)
#### Post date: [March 24, 2006, 7:44pm UTC](https://community.mp3tag.de/t/help-with-regex-please/3089/1 "2006-03-24T19:44:30Z")

</div>

I’d appreciate help on a reg-exp for the following.

The original album tag tag reads:

“Mozart: Piano Sonata in F major, KV 280 **- III. Presto** - Mitsuko Uchida – Philips 1990 ”

And I need to change it to:

“Mozart: Piano Sonata in F major, KV 280 - Mitsuko Uchida – Philips 1990”

The single string to be removed is variable in length, and will always be the first such string in a series separated by dashes. The string may contain non-alphameric characters like "." or "-".

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Sebastian\_Mares](https://community.mp3tag.de/user_avatar/community.mp3tag.de/sebastian_mares/32/9285_2.png) [@Sebastian\_Mares](https://community.mp3tag.de/u/Sebastian_Mares)
#### Post date: [March 24, 2006, 8:39pm UTC](https://community.mp3tag.de/t/help-with-regex-please/3089/2 "2006-03-24T20:39:17Z")

</div>

Try this:

Action #1:  
_Action type:_ **Replace with regular expressions**  
_Field:_ **ALBUM**  
_Regular expression:_ **^(._) - (._) - (.\*)$**  
_Replace matches with:_ **$1 - $3**

[] case-sensitive comparison

However, errors may occur if the string you want to remove contains " - ".

---

<div class="post-metadata">

### Author: ![PeterT](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/f1d935/32.png) [@PeterT](https://community.mp3tag.de/u/PeterT)
#### Post date: [March 24, 2006, 8:57pm UTC](https://community.mp3tag.de/t/help-with-regex-please/3089/3 "2006-03-24T20:57:30Z")

</div>

Brilliant! Thanks.

---

<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:19pm UTC](https://community.mp3tag.de/t/help-with-regex-please/3089/4 "2026-02-09T12:19:42Z")

</div>


