# Regex Replace unexpected match

**URL:** https://community.mp3tag.de/t/regex-replace-unexpected-match/53888
**Category:** Support
**Created:** [July 28, 2021, 10:00pm UTC](https://community.mp3tag.de/t/regex-replace-unexpected-match/53888 "2021-07-28T22:00:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![turnedup5922](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/f9ae1b/32.png) [@turnedup5922](https://community.mp3tag.de/u/turnedup5922)
#### Post date: [July 28, 2021, 10:00pm UTC](https://community.mp3tag.de/t/regex-replace-unexpected-match/53888/1 "2021-07-28T22:00:36Z")

</div>

This may be a bug, I'm not sure. I don't recall it functioning like this in the past, however it's been over a year since I was using MP3Tag regularly due to illness, moving, and other factors. I did however use this regularly before and I don't recall this issue.

Replace with Regex seems to be working imperfectly in this case.

Steps to reproduce:  
Title Tag (Example) is AAA BBB just for a general Idea of what the end result is.

Actions Quick - Replace with Regex  
Field: Title  
Regular Expression: (.\*)  
Replace Matches with: ZZZ - $1

Notes Regarding Above:  
Field: I have used Title/Album/Artist (any will work)  
Regular Expression: Meant to Capture All (I have used a few variations of this including (.\*+) ... (.+) DOES work, so by capturing all (greedy) something's causing this to malfunction I assume  
Replace Matches with: This is just an example, anything I try and put at the front causes this issue

Expected results is to:  
"ZZZ - AAA BBB"  
Actual Result:  
"ZZZ - AAA BBBZZZ - "

As mentioned above, I know that (.+) works fine and comes to the expected result. Also, I understand that formatting the tag is an options too, I have used both, but as far as I'm aware this is a bug, and though I've been using the other options the last week or two, I thought I'd get around to reporting it since I'm going to post another question anyway.

---

<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: [July 29, 2021, 4:28am UTC](https://community.mp3tag.de/t/regex-replace-unexpected-match/53888/2 "2021-07-29T04:28:46Z")

</div>

See this thread:

> [@\[X\] $regexp(X,.\*$,YY)](https://community.mp3tag.de/t/x-regexp-x-yy/6261):
>
> [EDITED:] ... returns YYYY rather than YY as documented.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [July 29, 2021, 9:57am UTC](https://community.mp3tag.de/t/regex-replace-unexpected-match/53888/3 "2021-07-29T09:57:42Z")

</div>

See also [this example](https://regex101.com/r/Zm3rAN/1/) for a listing and explanation of the matches.

---

<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:29pm UTC](https://community.mp3tag.de/t/regex-replace-unexpected-match/53888/4 "2026-02-09T12:29:20Z")

</div>


