# $replace()/$regex() breaks with %\_total\_size% (in export)

**URL:** https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [August 11, 2011, 7:43pm UTC](https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378 "2011-08-11T19:43:21Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Qtax](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/f05b48/32.png) [@Qtax](https://community.mp3tag.de/u/Qtax)
#### Post date: [August 11, 2011, 7:43pm UTC](https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378/1 "2011-08-11T19:43:21Z")

</div>

**Export code example 1** :

```
%_total_size% => $replace(z0z %_total_size% z0z,0,X)

```

**Result** :

```
104,27 MB => z0z 104

```

**Expected** :

```
104,27 MB => zXz 1X4,27 MB zXz

```

**Problem** :  
No replacement at all and things after %\_total\_size% are not even included.

Export code example 2:

```
%_total_size% => $replace(z0z $trim(%_total_size%) z0z,0,X)

```

**Result** :

```
104,27 MB => zXz 1X4 zXz

```

**Expected** :

```
104,27 MB => zXz 1X4,27 MB zXz

```

**Problem** :  
%\_total\_size% does not have any unit nor decimal part.

Same behavior can be observed with $regex(), and I'm guessing other (string) functions. Is this bug by design?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 12, 2011, 12:21am UTC](https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378/2 "2011-08-12T00:21:47Z")

</div>

Yes this looks like a bug.  
I was able to repeat the buggy behaviour.  
[20110812.Test.mte](https://community.mp3tag.de/uploads/default/original/2X/2/2a709e382690585147abc69f64a131e38ef8703d.mte) (662 Bytes)

But I am not really sure, because Mp3tag system info fields are not tag fields, and it is not documented, if info fields can be treated the same way as tag fields in the Mp3tag export environment.

DD.20110812.0422.CEST

---

<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: [December 22, 2018, 11:53am UTC](https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378/3 "2018-12-22T11:53:33Z")

</div>

I've fixed this with [Mp3tag v2.91b](https://community.mp3tag.de/t/455). Thanks for reporting, the excellent test-case and patience 🙂

---

<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: [January 21, 2019, 11:53am UTC](https://community.mp3tag.de/t/replace-regex-breaks-with-total-size-in-export/12378/4 "2019-01-21T11:53:35Z")

</div>

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