# Help with trimming leading characters

**URL:** <https://community.mp3tag.de/t/help-with-trimming-leading-characters/14779>\
**Category:** Support\
**Created:** [June 3, 2013, 1:19pm UTC](https://community.mp3tag.de/t/help-with-trimming-leading-characters/14779 "2013-06-03T13:19:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aluminari](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@Aluminari](https://community.mp3tag.de/u/Aluminari)\
**Post date:** [June 3, 2013, 1:19pm UTC](https://community.mp3tag.de/t/help-with-trimming-leading-characters/14779/1 "2013-06-03T13:19:50Z")

</div>

Hi guys,

I tried to follow the tutorial to remove leading characters but it doesn't seem to work when I try it. It only works on some files. I am currently using:

Replace with regular expression  
Field: \_FILENAME  
Reg. Expression: ^\s\*\d+\s\*-\s\*  
Replace matches with:

But I still have many files left with:  
01 myfilename

1. myfilename  
100 myfilename

Etc.

How do I remove everything before the starting "myfilename". I had it on my old machine but reinstalled without backing up my actions.

I'm also looking to find how to remove underscores, and also trim the end of the file for anything after the hyphen (-) but before the .mp3

Sorry to ask but had no luck with the search.

Thanks

---

<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:** [June 3, 2013, 2:15pm UTC](https://community.mp3tag.de/t/help-with-trimming-leading-characters/14779/2 "2013-06-03T14:15:01Z")

</div>

> [@Marco Ruschioni](#):
>
> Replace with regular expression  
> Field: \_FILENAME  
> Reg. Expression: ^\s\*\d+\s\*-\s\*  
> Replace matches with:
> 
> But I still have many files left with:  
> 01 myfilename
> 
> 1. myfilename  
> 100 myfilename

An all in-one solution would be:

Reg. Expression: ^\s\*\d\*\s\*._-_\s\*

Notice i've only added:  
.\* which matches the . litlerally between 0 and an unlimited amount of times  
and a \* quantifier to the - which again will look for that character 0-unlimted times.

Or you can use:  
**^** [^a-zA-Z]+

This removes anything other than a-z or A-Z from the **^** which anchors to the beginning of the string.

Replace \_ can be done with the a simple replace function

Removing before the extension and after the last - is:  
Field: \_FILENAME  
Expression: (.+)\s\*-[^-]+(..{3,4})$  
Replace with: $1$2

---

<div class="post-metadata">

**Author:** ![Aluminari](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@Aluminari](https://community.mp3tag.de/u/Aluminari)\
**Post date:** [June 4, 2013, 5:36am UTC](https://community.mp3tag.de/t/help-with-trimming-leading-characters/14779/3 "2013-06-04T05:36:49Z")

</div>

> [@stevehero](#):
>
> An all in-one solution would be:
> 
> Reg. Expression: ^\s\*\d\*\s\*._-_\s\*
> 
> Notice i've only added:  
> .\* which matches the . litlerally between 0 and an unlimited amount of times  
> and a \* quantifier to the - which again will look for that character 0-unlimted times.
> 
> Or you can use:  
> **^** [^a-zA-Z]+
> 
> This removes anything other than a-z or A-Z from the **^** which anchors to the beginning of the string.
> 
> Replace \_ can be done with the a simple replace function
> 
> Removing before the extension and after the last - is:  
> Field: \_FILENAME  
> Expression: (.+)\s\*-[^-]+(..{3,4})$  
> Replace with: $1$2

Thank you so much!

---

<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-with-trimming-leading-characters/14779/4 "2026-02-09T12:24:31Z")

</div>

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


