# Help with RegExp

**URL:** <https://community.mp3tag.de/t/help-with-regexp/15969>\
**Category:** Support\
**Created:** [August 3, 2014, 8:19pm UTC](https://community.mp3tag.de/t/help-with-regexp/15969 "2014-08-03T20:19:51Z")\
**Posts on this page:** 6\
**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 3, 2014, 8:19pm UTC](https://community.mp3tag.de/t/help-with-regexp/15969/1 "2014-08-03T20:19:51Z")

</div>

I am new to Regular Expression but just cannot get my expression to do exactly what I want.

I have a list music which lists "artist - Track" but sometimes it will be formatted like

0001 - Mozart - Divertimento in D

I am after a RegEep that will remove all the characters before Mozart

**Result**

Mozart - Divertimento in D

---

<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 4, 2014, 4:46am UTC](https://community.mp3tag.de/t/help-with-regexp/15969/2 "2014-08-04T04:46:36Z")

</div>

If the characters are numbers try this:  
Replace with regular Expression for the field  
Search string: ^\d+ -  
(there is a blank behind the -)  
Replace with:  
(leave that empty)

---

<div class="post-metadata">

**Author:** ![Nature](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/a587f6/32.png) [@Nature](https://community.mp3tag.de/u/Nature)\
**Post date:** [August 4, 2014, 9:28am UTC](https://community.mp3tag.de/t/help-with-regexp/15969/3 "2014-08-04T09:28:27Z")

</div>

> [@Dego](#):
>
> I am new to Regular Expression but just cannot get my expression to do exactly what I want.
> 
> I have a list music which lists "artist - Track" but sometimes it will be formatted like
> 
> 0001 - Mozart - Divertimento in D
> 
> I am after a RegEep that will remove all the characters before Mozart
> 
> **Result**
> 
> Mozart - Divertimento in D

You were not very specific about your task:

1. Are you going to replace it using a simple text editor on your text file?
2. Are you doing it on a set of tracks, using Mp3Tag?

Possible Answers:

1. If you're doing it on a text editor like Notepad++ or EmEditor, this will do the work:  
FIND...: (._)(Mozart._)  
REPLACE: \2

Group 1: (._) - Will match anything, be it a digit, letter or special character.  
Group 2: (Mozart._) - This will match anything that starts with the word Mozart, and everything else until the end of the line.  
\2 - This will tell the RegEx "parser" to ignore the first group, and just keep the second, which is the one you want, right? 🙂

1. If you're using an action in MP3Tag, then you can do it directly with an Action of Type: Replace with Regular Expression.  
I'm uploading a screenshot of the dialogue box, with the fields filled, so that you can see what I mean.

![](https://community.mp3tag.de/uploads/default/original/2X/1/1ca301c41705253da8f111b0916626fa20b7982e.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:** [August 4, 2014, 3:32pm UTC](https://community.mp3tag.de/t/help-with-regexp/15969/4 "2014-08-04T15:32:31Z")

</div>

> [@Dego](#):
>
> I am new to Regular Expression but just cannot get my expression to do exactly what I want. ... 0001 - Mozart - Divertimento in D ... I am after a RegEep that will remove all the characters before Mozart ...

If you are not so familiar with the RegExp scripting language, then you can apply a simple Mp3tag scripting standard function to get the wanted result ...

**$trimLeft('0001 - Mozart - Divertimento in D','0123456789 -') ==\> 'Mozart - Divertimento in D'**

... apply it against a placeholder of your wish, e. g. %TITLE% or %\_FILENAME%.

DD.20140804.1932.CEST

---

<div class="post-metadata">

**Author:** ![Nature](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/a587f6/32.png) [@Nature](https://community.mp3tag.de/u/Nature)\
**Post date:** [August 5, 2014, 3:18pm UTC](https://community.mp3tag.de/t/help-with-regexp/15969/5 "2014-08-05T15:18:14Z")

</div>

> [@DetlevD](#):
>
> **$trimLeft('0001 - Mozart - Divertimento in D','0123456789 -') ==\> 'Mozart - Divertimento in D'**

Many thanks for that tip, DetlevD!  
It's great and I didn't know about that. 🙂

Unfortunately, the help web page is misleading:  
[https://docs.mp3tag.de/scripting](https://docs.mp3tag.de/scripting)

It states: "The optional second parameter specifies the character to trim."  
Since it uses the single form of character, I would never have thought it would also work with a _string_ (group) of characters.

But I've just tried it with the Action type : Format Field, and it does work as you said. 🙂

I think that the help file should be changed, to clearly show that.

---

<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/help-with-regexp/15969/6 "2026-02-09T12:25:10Z")

</div>

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


