# Replace and Replace regexp actions issues

**URL:** https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006
**Category:** Support
**Created:** [April 5, 2026, 3:17pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006 "2026-04-05T15:17:50Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Qadddd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/67e7ee/32.png) [@Qadddd](https://community.mp3tag.de/u/Qadddd)
#### Post date: [April 5, 2026, 3:17pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/1 "2026-04-05T15:17:50Z")

</div>

Hello?

I would like to set the Album name to all mp3’s files of my directory and decided to use Replace or Replace by a regexp.

1. Use Replace : not possible to use it if Album field is currently empty because. Creating the action, “Original” has to be set to a value to be saved and cannot remain as void.  
Having a Album field equal to XX and replacing it by ZZ works fine.

2. Use Replace by a regexp : several problems here:  
2a) using “.\*” as regexp (meaning any character zero or several times) seems to not work on empty field, replacement is not performed. Note: I added double quotes and backslash in this text to avoid italic mode creating this report, but the target is only dot+star  
2b) using “.\*” as regexp when field is not void works, but the replacement value is doubled, example: field equals XX and I would like to replace by AB, the result after replacement will be ABAB and I have no clue why, no other action selected.  
Example :  
Here is an extract of my directory. Album is set to XX

---

<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: [April 5, 2026, 3:32pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/2 "2026-04-05T15:32:40Z")

</div>

Could you please provide two [screenshots](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#p-168842-use-screenshots-to-exemplify-the-issue-2) showing your attempts with the "Replace" and "Replace with regular expression" Actions?

Also, show us a screenshot of some of your existing folders.

Without this information, it will be almost impossible to reproduce the "bug".

---

<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: [April 5, 2026, 3:50pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/3 "2026-04-05T15:50:21Z")

</div>

> [@Qadddd](#):
>
> field is currently empty

I think this is a basic misunderstanding: there is no table in the tag area that has a reserved space for a particular piece of information.  
A field that has no data does not exist. So there is no object that can be searched and replaced.  
If you want to set the contents for a field, you have to use "Format value" or any other action or converter that creates the field with contents.

---

<div class="post-metadata">

### Author: ![Qadddd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/67e7ee/32.png) [@Qadddd](https://community.mp3tag.de/u/Qadddd)
#### Post date: [April 5, 2026, 9:36pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/4 "2026-04-05T21:36:04Z")

</div>

For bug #2, I updated my previous post to insert screen shots before, after and the Action supposed to be executed.  
To reproduce bug #1, just try to create an action Replace and try to save without any value in “Original“ field, OK is not activated until “Original“ is set.

---

<div class="post-metadata">

### Author: ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)
#### Post date: [April 5, 2026, 11:10pm UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/5 "2026-04-05T23:10:16Z")

</div>

> [@Qadddd](#):
>
> I would like to set the Album name to all mp3’s files of my directory and decided to use Replace or Replace by a regexp.

As @ohrenkino mentioned above, you should use a “Format value” action.

Try this:

 ![Action](https://community.mp3tag.de/uploads/default/original/3X/a/b/ab3eec5a97dea9c1ab9c9f42e4028cf1efd8ad30.jpeg)

---

<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: [April 6, 2026, 6:52am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/6 "2026-04-06T06:52:18Z")

</div>

> [@Qadddd](#):
>
> And here if the result of the Action execution. Album is set to ABAB instead of just AB

I think this is normal as the normal behaviour as any hit gets replaced with "AB".  
A -\> AB  
B -\> AB  
-\>-\> ABAB  
If you use "ABC" as source you get "ABABAB".

The non-existing field yield no hit so the regular expression returns the original search string which is empty. And empty fields do not and cannot exist, therefore you do not see the intended contents.

---

<div class="post-metadata">

### Author: ![rboss](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/5f9b8f/32.png) [@rboss](https://community.mp3tag.de/u/rboss)
#### Post date: [April 7, 2026, 3:57am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/7 "2026-04-07T03:57:34Z")

</div>

> [@ohrenkino](#):
>
> I think this is normal as the normal behaviour as any hit gets replaced with "AB".  
> A -\> AB  
> B -\> AB  
> -\>-\> ABAB  
> If you use "ABC" as source you get "ABABAB".

Just a minor correction:

When using a regex replace with `.*` you will get a duplicate of your replacement string; this happens because there will always be 2 hits: one with the matched string ("A","B","ABC", etc.) **and** one with a -I'll call it for clarity- _null string_.

Because the use of .\* literally means "find 0 or more instances of any character; with greedy search", the first match will be the "greedy search" --\> the entire original string, and the second match will be the "0-length instance" immediately after the string.

@Qadddd If it were possible to have empty tag fields, your 2a) reasoning would be correct; and your 2b) reasoning logic fails to consider the second null match. If you wish to use regex, I suggest testing your formulas with an 3rd-party regex evaluator, like [regex101.com](http://regex101.com), before applying to your music.  
For your 2b) scenario, I suggest using `.+` (1 or more instances of a character - therefore avoiding nulls), or `^.*` (still matching 0+ characters, but only at the beginning of the string - which will only happen once).

> [@ohrenkino](#):
>
> If you use "ABC" as source you get "ABABAB".

@ohrenkino With the above I meant to say that if you use "ABC" as source you would still get "ABAB", same as "A", "AB", or even "ABCDEFGH".

I see no reason for this topic to be a bug report for Mp3Tag, since the regular expression engine is working correctly in this situation.

Hope this helps.

---

<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: [April 7, 2026, 6:15am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/8 "2026-04-07T06:15:08Z")

</div>

> [@rboss](#):
>
> I see no reason for this topic to be a bug report for Mp3Tag, since the regular expression engine is working correctly in this situation.

I completely agree.  
Which leaves the first observation about the simple replace and that circles around empty fields.  
I would assume that the mechanism could be explained as follows:  
The search starts in a non-existing string and therefore, there will never be any hits. And as there are no hits these cannot be replaced.  
The UI caters for that and does not allow empty strings for the original string.  
Which, again, would be "works as designed, no bug".  
Topic gets moved to #Support.

---

<div class="post-metadata">

### Author: ![Qadddd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/67e7ee/32.png) [@Qadddd](https://community.mp3tag.de/u/Qadddd)
#### Post date: [April 7, 2026, 10:03am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/9 "2026-04-07T10:03:45Z")

</div>

This is THE solution, this forces the field to take the value you give if the original value is set or empty. Thanks

---

<div class="post-metadata">

### Author: ![Qadddd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/67e7ee/32.png) [@Qadddd](https://community.mp3tag.de/u/Qadddd)
#### Post date: [April 7, 2026, 10:09am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/10 "2026-04-07T10:09:16Z")

</div>

Nope, I try XXX as original value and the result is still ABAB.  
And if I follow your logic, with X as original value, the result would be AB.  
^.\*$ as regexp to take the whole field from the start of field to the end of field fixed the problem. But, as mentionned above, Format value action is THE solution and it avoids regexp mind torture ;-).

---

<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: [April 14, 2026, 10:09am UTC](https://community.mp3tag.de/t/replace-and-replace-regexp-actions-issues/71006/11 "2026-04-14T10:09:59Z")

</div>

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