# How to add white space in a name?

**URL:** <https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330>\
**Category:** Support\
**Created:** [November 14, 2014, 11:02pm UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330 "2014-11-14T23:02:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kING4000](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/cab0a1/32.png) [@kING4000](https://community.mp3tag.de/u/kING4000)\
**Post date:** [November 14, 2014, 11:02pm UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/1 "2014-11-14T23:02:37Z")

</div>

I want to convert a name in the field _artists_ by using regular expressions

The name is in this format:  
**a.b.name, c.d.e.name**

i need it to be as:  
**A. B. Name, C. D. E. Name**

i am not sure how to search the forum for such an example, so i am sorry if this is already answered. Thanks for the help in advance.

---

<div class="post-metadata">

**Author:** ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)\
**Post date:** [November 15, 2014, 6:36am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/2 "2014-11-15T06:36:26Z")

</div>

You don't need a regular expresion to insert the white space.  
Just create an action group with 2 actions.  
First action is a simple replace action.

Field: ARTIST  
Original: .  
Replace with: .

Note: There is a white space behind the dot in "Replace with" that you don't see here.

After inserting the white space you can change to capital letters:

Action Format Value:  
Field: ARTIST  
Format String: $caps(%artist%)

---

<div class="post-metadata">

**Author:** ![kING4000](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/cab0a1/32.png) [@kING4000](https://community.mp3tag.de/u/kING4000)\
**Post date:** [November 15, 2014, 6:47am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/3 "2014-11-15T06:47:50Z")

</div>

> [@poster](#):
>
> You don't need a regular expresion to do this.  
> Just take a simple replace action.
> 
> Field: artist  
> Original: .  
> Replace with: .
> 
> Note: There is a white space behind the dot in "Replace with" that you don't see here.

I already tried this and it doesn't work properly. It adds an extra space for correctly formatted names. So **A.\_B.\_Name** becomes **A.\_\_B.\_\_Name** (the underscore represents space)

---

<div class="post-metadata">

**Author:** ![vkostas](https://community.mp3tag.de/user_avatar/community.mp3tag.de/vkostas/32/227_2.png) [@vkostas](https://community.mp3tag.de/u/vkostas)\
**Post date:** [November 15, 2014, 7:52am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/4 "2014-11-15T07:52:15Z")

</div>

> [@kING4000](#):
>
> I want to convert a name in the field _artists_ by using regular expressions
> 
> The name is in this format:  
> **a.b.name, c.d.e.name**
> 
> i need it to be as:  
> **A. B. Name, C. D. E. Name**
> 
> i am not sure how to search the forum for such an example, so i am sorry if this is already answered. Thanks for the help in advance.

Action Format Value:  
Field: ARTIST

1. Add exactly one space after (.) not followed by space. Convert to Mixed Case.  
Format String: $caps($regexp(%artist%,'(.)(?!\s)','$1 '))
2. Add exactly one space after (.) not followed by space and remove additional trailing spaces. Convert to Mixed Case.  
Format String: $caps($regexp(%artist%,'(.)((?!\s)|\s+)','$1 '))

---

<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:** [November 15, 2014, 9:31am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/5 "2014-11-15T09:31:09Z")

</div>

> [@Victor Kostas](#):
>
> Action Format Value:  
> Field: ARTIST
> 
> 1. Add exactly one space after (.) not followed by space. Convert to Mixed Case.  
> Format String: $caps($regexp(%artist%,'(.)(?!\s)','$1 '))
> 2. Add exactly one space after (.) not followed by space and remove additional trailing spaces. Convert to Mixed Case.  
> Format String: $caps($regexp(%artist%,'(.)((?!\s)|\s+)','$1 '))

Just out of curiosity: why the hassle with the regular expression? To me it looks just like an ordinary "Replace" action: you replace one constant string (the dot) with another constant string (the dot plus blank).  
Afterwards you have to tidy it is up, again with a normal replace: replace two blanks with just one.  
And then you can do the $caps stuff ...  
So it should be possible to do  
$caps($replace(%artist%,'.','. ',' ',' '))

---

<div class="post-metadata">

**Author:** ![vkostas](https://community.mp3tag.de/user_avatar/community.mp3tag.de/vkostas/32/227_2.png) [@vkostas](https://community.mp3tag.de/u/vkostas)\
**Post date:** [November 15, 2014, 10:02am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/6 "2014-11-15T10:02:19Z")

</div>

> [@ohrenkino](#):
>
> Just out of curiosity: why the hassle with the regular expression? To me it looks just like an ordinary "Replace" action: you replace one constant string (the dot) with another constant string (the dot plus blank).  
> Afterwards you have to tidy it is up, again with a normal replace: replace two blanks with just one.  
> And then you can do the $caps stuff ...  
> So it should be possible to do  
> $caps($replace(%artist%,'.','. ',' ',' '))

Regular expression allows user to execute several times the action.  
With simple replace he may end with multiple trailing spaces after the dot when executing the action several times.  
On top of that $replace(,' ',' ') does not work for 2 or more spaces in a row. They will stay at least two spaces.

---

<div class="post-metadata">

**Author:** ![kING4000](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/cab0a1/32.png) [@kING4000](https://community.mp3tag.de/u/kING4000)\
**Post date:** [November 15, 2014, 6:22pm UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/7 "2014-11-15T18:22:36Z")

</div>

Awesome... Thanks Victor, much appreciated.

May be someone wants to change the title of this thread to better represent the problem? it will help with new searches.

---

<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:** [November 15, 2014, 6:34pm UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/8 "2014-11-15T18:34:57Z")

</div>

> [@](#):
>
> ...  
> On top of that $replace(,' ',' ') does not work for 2 or more spaces in a row. They will stay at least two spaces.

I just tested that with a couple of files and it removed the double spaces every time with just one.  
BUT: if you copy&paste the expression from this forum then it does not work as apparently the forum editor removes double blanks from pain text...  
So in that respect, I still think that the plain replace is just as nice as toghether with the double space remover it leads to just the same result.

---

<div class="post-metadata">

**Author:** ![vkostas](https://community.mp3tag.de/user_avatar/community.mp3tag.de/vkostas/32/227_2.png) [@vkostas](https://community.mp3tag.de/u/vkostas)\
**Post date:** [November 15, 2014, 8:09pm UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/9 "2014-11-15T20:09:12Z")

</div>

> [@ohrenkino](#):
>
> I just tested that with a couple of files and it removed the double spaces every time with just one.  
> BUT: if you copy&paste the expression from this forum then it does not work as apparently the forum editor removes double blanks from pain text...  
> So in that respect, I still think that the plain replace is just as nice as together with the double space remover it leads to just the same result.

I admit it works the same way for majority of cases for trailing spaces of dot.  
There are two differences.

1. Regexp will touch only trailing spaces of dots (.). :wink: **A.\_B.\_Group\_\_\_\_Name** would stay untouched from regexp while $replace would involve all spaces ( **A.\_B.\_Group\_\_Name** ). Still multiple spaces will stay.
2. **$replace(%artist%,'.','. ',' ',' ')** does not work as expected when applied to **A.\_\_\_B.\_\_\_Group\_Name** unlike **$regexp(%artist%,'(\.)((?!\s)|\s+)','$1 ')**. Result is **A.\_\_B.\_\_Group\_Name** vs **A.\_B.\_Group\_Name**.

In general **$regexp(value,'\s+','\s')** replaces multiple spaces in a row with exactly one space. **$replace('A\_\_B','\_\_','\_')** works well but not **$replace('A\_\_\_\_B','\_\_','\_')**. Maybe this behavior is a bug??? Regexp gives more freedom but it is more complicated. :slight\_smile:

---

<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:** [November 17, 2014, 11:40am UTC](https://community.mp3tag.de/t/how-to-add-white-space-in-a-name/16330/10 "2014-11-17T11:40:09Z")

</div>

Totally aside from the expression problem I also see a semantic problem.  
I know of band names like  
A.A.B.B. (Above Average Black Band)  
A.I.D.A.  
A.K.-S.W.I.F.T.  
A.M.C & Mattix & Futile  
Alex M.O.R.P.H. & Rank 1  
B.B. King  
Bcee & S.P.Y.  
C.C.S.  
D.I.T.C.  
D.A.F. (Deutsch Amerikanische Freundschaft)  
D.Ö.F (Deutsch-Österreichisches Feingefühl)  
DJ R.O.C.K.  
DJ S.P.U.D.  
I.Q.  
M.F.S.B.

and may more. These names apparently have to be written like this without the blanks after the dots .... so a lot of filtering will be necessary. Or undoing the changes ....

---

<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/how-to-add-white-space-in-a-name/16330/11 "2026-02-09T12:25:22Z")

</div>

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


