# Replace the first occurrence

**URL:** <https://community.mp3tag.de/t/replace-the-first-occurrence/58902>\
**Category:** Support\
**Created:** [October 27, 2022, 6:10pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902 "2022-10-27T18:10:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gialandra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/gialandra/32/12524_2.png) [@gialandra](https://community.mp3tag.de/u/gialandra)\
**Post date:** [October 27, 2022, 6:10pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/1 "2022-10-27T18:10:05Z")

</div>

Hi, I want to replace the first occurrence of a point "." with a space + dash " -" of some columns. Is it possible?

Thanks

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [October 27, 2022, 6:35pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/2 "2022-10-27T18:35:58Z")

</div>

This is for the column names, or the data in the list? Perhaps post a screenshot of what you have now, and describe in detail what you want to change.

---

<div class="post-metadata">

**Author:** ![gialandra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/gialandra/32/12524_2.png) [@gialandra](https://community.mp3tag.de/u/gialandra)\
**Post date:** [October 27, 2022, 7:15pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/3 "2022-10-27T19:15:05Z")

</div>

I want to change the data in the list (title and filename), this is the screenshot:

 ![2022-10-27_211243](https://community.mp3tag.de/uploads/default/original/2X/2/22574f8ee586a1f831251e94782e939dda688b1b.png)

---

<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:** [October 27, 2022, 9:06pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/4 "2022-10-27T21:06:13Z")

</div>

You could try an action of the type "Format value" for TITLE  
Format string: `$regexp(%title%,'(.*?)\.(.*)',$1 - $2)`  
This leads from "142 Numeri. Capitolo..." to "142 Numeri - Capitolo ..."

---

<div class="post-metadata">

**Author:** ![gialandra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/gialandra/32/12524_2.png) [@gialandra](https://community.mp3tag.de/u/gialandra)\
**Post date:** [October 27, 2022, 10:33pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/5 "2022-10-27T22:33:09Z")

</div>

The format string works good with a glitch: a double space to the right of the dash. I don't understand the syntax of string, is it possible correct it?  
Thanks

---

<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:** [October 28, 2022, 6:22am UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/6 "2022-10-28T06:22:09Z")

</div>

Please try  
Format string: `$regexp(%title%,'(.*?)\. (.*)',$1 - $2)`  
or  
Format string: `$regexp(%title%,'(.*?)\.(.*)',$1 -$2)`

---

<div class="post-metadata">

**Author:** ![gialandra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/gialandra/32/12524_2.png) [@gialandra](https://community.mp3tag.de/u/gialandra)\
**Post date:** [October 28, 2022, 7:21am UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/7 "2022-10-28T07:21:27Z")

</div>

It seems that both work perfectly even they are different, this is disorienting to me...

With the new format, tag switchs from ID3v2.4 to ID3v2.3. Is it normal?

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [October 28, 2022, 7:51am UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/8 "2022-10-28T07:51:35Z")

</div>

> [@gialandra](#):
>
> this is disorienting to me

Maybe it helps if you understand the function of `(.*?)\. (.*)`  
`(.*?)` looks for and groups every character BEFORE the first  
`\. ` dot and a space  
`(.*)` looks for and groups every character AFTER the above dot and space

If you prefer it as picture:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/1/179de506f0b4ec0b31bc2ab42552b0235a83a19b.png)

Then the content of `%TITLE%` (the 2 groups with the collected characters) will be replaced like this  
`$1` content of first group  
`- ` a space a minus/dash and a space character  
`$2` content of the second group

---

<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:** [October 28, 2022, 8:05am UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/9 "2022-10-28T08:05:57Z")

</div>

> [@gialandra](#):
>
> With the new format, tag switchs from ID3v2.4 to ID3v2.3. Is it normal?

This depends on the settings you have in File\>OptionsTags\>Mpeg.  
ID3V2.3 is still the tag version that is supported by most players.

---

<div class="post-metadata">

**Author:** ![gialandra](https://community.mp3tag.de/user_avatar/community.mp3tag.de/gialandra/32/12524_2.png) [@gialandra](https://community.mp3tag.de/u/gialandra)\
**Post date:** [October 28, 2022, 8:09pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/10 "2022-10-28T20:09:29Z")

</div>

Thank you all for your help and useful explanations

---

<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:** [November 27, 2022, 8:09pm UTC](https://community.mp3tag.de/t/replace-the-first-occurrence/58902/11 "2022-11-27T20:09:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
