# Regex Required: SPACE • DOT

**URL:** <https://community.mp3tag.de/t/regex-required-space-dot/19681>\
**Category:** Support\
**Created:** [January 11, 2018, 11:09am UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681 "2018-01-11T11:09:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 11, 2018, 11:09am UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681/1 "2018-01-11T11:09:37Z")

</div>

When tagging multiple-disc albums, I usually let Mp3tag fetch the album name (or a portion thereof) from the %\_directory% field, using the Format Value Action. The album name then may look something like this:

"The Ultimate Classical Album . **CD1.** Relax At Home"

The latter portion of the preceding album name i.e. "CD1. Relax At Home", is derived from %\_directory%.

Now, I need to format this particular album field with the Mp3 tagging tools at hand, so that that the second DOT in the album field-- the one which follows directly after the CD-number, is preceded with a space. It should then look like this:

"The Ultimate Classical Album . **CD1 .** Relax At Home"

Could you please assist me with a regular expression, or another scripting function that will take care of this?

Your assistance is always greatly appreciated.

---

<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:** [January 11, 2018, 12:21pm UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681/2 "2018-01-11T12:21:25Z")

</div>

> [@ragtag](#):
>
> "The Ultimate Classical Album . **CD1.** Relax At Home"

Breaking it down into captures.

To match **The Ultimate Classical Album . CD1. Relax At Home**

```
(?i)^(.+?[^\s])\s*\.\s*cd(\d+)\s*\.\s*(.+)

```

Then **$1** will represent the first part  
**CD$2** the CD with no.  
**$3** the final part.

You can keep the same reg exp. Just fill in the format with section with whatever you want with either using the **$1 $2** or **$3**.

**EDIT I went a little overboard.**![:w00t:](https://community.mp3tag.de/uploads/default/original/1X/cb01eca72fe9339ff6f3ec9f1e3c5fe002be0f0a.gif ":w00t:")

Your task can use the same expression.

```
(?i)^(.+?[^\s])\s*\.\s*cd(\d+)\s*\.\s*(.+)

```

Then use:

```
$1 . CD$2 . $3

```

In the replace with in the reg exp action.

Like I said it's overboard but you might learn something from this. But it will ensure that you've got the correct format in all your cases 🙂

---

<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:** [January 11, 2018, 12:23pm UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681/3 "2018-01-11T12:23:19Z")

</div>

Why don't you  
replace all dots with blank-dot-blank in a first plain replace action and then  
replace all double-blanks with a single blank in the next plain replace action. Done.

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 11, 2018, 4:41pm UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681/4 "2018-01-11T16:41:23Z")

</div>

Thank you to you both, stevehero and ohrenkino, for your quick responses.

Before I submitted my original post, I was already employing exactly the method proposed here by ohrenkino, but I thought there was an even quicker method. 😛

Stevehero, I am going to experiment with your proposal as well. When you went "overboard" 😃 in the beginning, it scared the wits out of me, but your final final expression may just save me step or two.

Thanks again!

---

<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:27pm UTC](https://community.mp3tag.de/t/regex-required-space-dot/19681/5 "2026-02-09T12:27:11Z")

</div>


