# Help to add Spaces Before and After dash

**URL:** https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165
**Category:** Support
**Created:** [March 1, 2012, 12:29pm UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165 "2012-03-01T12:29:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@sman](https://community.mp3tag.de/u/sman)
#### Post date: [March 1, 2012, 12:29pm UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/1 "2012-03-01T12:29:58Z")

</div>

hello guys !

need help to add spaces before and after dash, only if is one dash in filename:

Berlin-You dont know.mp3

```
           to be

```

Berlin - You dont know.mp3

but if are 2 or more dashes in the filename, do not change the file name:

Connells- 74-75

```
       or

```

A-Ha -Crying in the rain

to be same (need manual rename)

tks for any help !

---

<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: [March 1, 2012, 2:08pm UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/2 "2012-03-01T14:08:40Z")

</div>

> [@sman](#):
>
> need help to add spaces before and after dash, only if is one dash in filename:  
> Berlin-You dont know.mp3
> 
> ```
> to be
> 
> ```
> 
> Berlin - You dont know.mp3
> 
> but if are 2 or more dashes in the filename, do not change the file name:  
> Connells- 74-75
> 
> ```
> or
> 
> ```
> 
> A-Ha -Crying in the rain  
> to be same (need manual rename)  
> tks for any help !

Action: Format value  
Field: \_FILENAME  
Format string: **$regexp(%\_filename%,'^([^-]+?)(-)([^-]+?)$','$1 $2 $3')**

Filter:

**"%\_filename%" MATCHES "^([^-]+?)(-)([^-]+?)$"**

DD.20120301.1618.CET

---

<div class="post-metadata">

### Author: ![sman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@sman](https://community.mp3tag.de/u/sman)
#### Post date: [March 2, 2012, 9:15am UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/3 "2012-03-02T09:15:34Z")

</div>

thanks a lot !!!

working ![:music:](https://community.mp3tag.de/uploads/default/original/1X/2ba05d1ade5eb0d15fc173be6f717dbe63890a70.gif ":music:")

now,  
can you help me with a filter to hide filenames with dashes, like:

Connells- 74-75  
A-Ha -Crying in the rain  
Berlin - You dont know.mp3

and show only files like:

[01] be happy.flac  
La donna e mobile.mp3

---

<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: [March 2, 2012, 9:40am UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/4 "2012-03-02T09:40:05Z")

</div>

> [@sman](#):
>
> ..  
> can you help me with a filter to hide filenames with dashes, like:

NOT %\_filename% HAS "-"

---

<div class="post-metadata">

### Author: ![sman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/85f322/32.png) [@sman](https://community.mp3tag.de/u/sman)
#### Post date: [March 2, 2012, 9:33pm UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/5 "2012-03-02T21:33:37Z")

</div>

> [@ohrenkino](#):
>
> NOT %\_filename% HAS "-"

that was easy, tks dude !

---

<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:23pm UTC](https://community.mp3tag.de/t/help-to-add-spaces-before-and-after-dash/13165/6 "2026-02-09T12:23:42Z")

</div>


