# Need help with reg expression

**URL:** https://community.mp3tag.de/t/need-help-with-reg-expression/10876
**Category:** Support
**Created:** [September 28, 2010, 1:33pm UTC](https://community.mp3tag.de/t/need-help-with-reg-expression/10876 "2010-09-28T13:33:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![350zfan](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/3/e274bd/32.png) [@350zfan](https://community.mp3tag.de/u/350zfan)
#### Post date: [September 28, 2010, 1:33pm UTC](https://community.mp3tag.de/t/need-help-with-reg-expression/10876/1 "2010-09-28T13:33:44Z")

</div>

Hey Guys,

I looked through the RegEx thread and tried to figure our how to do this but I can't get it o work for the life of me.

I have about 3000 thousand songs that are named incorrectly in the filename but the but the TITLE in the TAG is correct, the only problem is that the tag has a bunch of useless information all different for all songs in the TITLE and I want to correct it.

Example:  
TITLE= "Sexy B\*\*\*h [Album Version]/(Feat. Akon)/Album Version"

Now I can't just rename the filename based on the tag because of the "/", doing so would make the filename "Sexy B\*\*\*h [Album Version]" and I want the "(Feat. AKon)" in this case. So in this case I have gone and replaced all the "/" with "-----" so now I have "Sexy B\*\*\*h [Album Version]-----(Feat. Akon)-----Album Version". Now 3000 songs have "----- blah blah blah" at the end. and I want to remove that. I don't mind the manual work for the songs that have "Feat." in them but all my songs have the junk at the end.

What what I use to remove the "-----" and everything after it?

Thanks a million

---

<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: [September 29, 2010, 3:10am UTC](https://community.mp3tag.de/t/need-help-with-reg-expression/10876/2 "2010-09-29T03:10:39Z")

</div>

> [@350zfan](#):
>
> "so now I have "Sexy B\*\*\*h [Album Version]-----(Feat. Akon)-----Album Version".  
> have "----- blah blah blah" at the end.
> 
> What what I use to remove the "-----" and everything after it?
> 
> Thanks a million

I am not quite sure where the "----- blah blah blah" starts for you - there are 2 occurrences.  
Anyway: what you do is either use the tag - Filename converter or an action to format the tag field "%\_filenme%.  
Enter

$left(%title%,$strstr(%title%,"----")-1)  
This uses all the characters in %title%, starting at the left-most character in %title% until it reaches the pattern "----" for the first time.

BTW: using the tag-filename converter may be a little more convenient as you can easily add other fields as well e.g. %track%.

---

<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:22pm UTC](https://community.mp3tag.de/t/need-help-with-reg-expression/10876/3 "2026-02-09T12:22:35Z")

</div>


