# Change file extension to lowercase - Regular expression

**URL:** https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816
**Category:** General Discussion
**Created:** [January 27, 2023, 2:46pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816 "2023-01-27T14:46:12Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 2:46pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/1 "2023-01-27T14:46:12Z")

</div>

Seems like the regular expression thread is locked

> [@Regular Expressions](https://community.mp3tag.de/t/regular-expressions/521/71):
>
> Few tips can help reduce complexity of Regular Expressions and likely make them run faster (see point 5). Mp3Tag uses Perl Regular Expressions. $ vs \ in replacement section. e.g. swap artist name. Mercury, Freddy --\> Freddy Mercury RegExp: (\w+),(\w+) ReplaceWith: \2, \1 \2, \1 is equivalent to $2, $1 and ${2} ${1} The later is very useful if a fixed digit must be added after a group, e.g. ${1}3 adds digit 3 after group1. \w+ captures a series of ASCII characters. Named group. Eve…

Previously found some nice examples there, why was it closed?

Not an overly complex one but couldn't find it so posting here in case it's useful to someone else:

Had a number of uppercase file extensions and was looking to convert them all to lowercase; there doesn't seem to be such a thing as the '"file extension" field so here's my take on it:

Field : \_FILENAME  
Regular expression : `\.(.*)$`  
Replace with : `.$lower($1)`

Cheers,

---

<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 27, 2023, 3:02pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/2 "2023-01-27T15:02:39Z")

</div>

> [@123qweasd](#):
>
> there doesn't seem to be such a thing as the '"file extension" field

There is:  
%\_extension%  
The example that you give is not complete as it does not state which field/property you treat with the action.

The same could probably be achieved with an action of the type "Format value" for \_EXTENSION and  
Format string: `$lower(%_extension%)`  
Or an action of the type "Case conversion" for the same field.  
Provided, this would work at all.  
I tried the action and I see no difference.

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 3:58pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/3 "2023-01-27T15:58:36Z")

</div>

Thanks for the feedback, I have updated the field used above;

I have the latest version and my first thought was indeed to use case conversion but for some reason, I just don't see the \_EXTENSION field as available. Probably missing something obvious in settings, will check again...

 ![Screenshot 2023-01-27 10.55.24](https://community.mp3tag.de/uploads/default/original/2X/2/28db68e113057cc5c49252c12dbb4cac92630edd.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: [January 27, 2023, 4:05pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/4 "2023-01-27T16:05:35Z")

</div>

If the field does not appear in the list, you can type it in.

---

<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: [January 27, 2023, 4:07pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/5 "2023-01-27T16:07:15Z")

</div>

Even if the preview indicate that this SHOULD work, it doesn't change anything at the filename and/or extension:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/0/0de6460fedac8f52f2b965c6043753b2b1f2a198.png)

Windows 10, NTFS, Mp3tag v3.19

_Update #1:_  
Using \_FILENAME\_EXT with or without enclosing %-Characters creates a new tag with the same name. 😊

Update #2: Convert Filename - Filename doesn't change the syntax of the extension (but works for the filename itself, without extension):  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/6/6474f12ed303780e4ae66a759f93ce7f56020b1c.png)

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 4:07pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/6 "2023-01-27T16:07:47Z")

</div>

Ok got it. If I may: any reason why it doesn't appear in the list? thx

---

<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 27, 2023, 4:09pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/7 "2023-01-27T16:09:48Z")

</div>

Perhaps because it is a property like \_LENGTH or \_MODE that cannot be modified?

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 4:15pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/8 "2023-01-27T16:15:15Z")

</div>

I've tried these without success:

![image](https://community.mp3tag.de/uploads/default/original/2X/6/66f9da2d5d8aa65b5615694b23d894bc1d5cdd6c.png)

![image](https://community.mp3tag.de/uploads/default/original/2X/d/d0e5bc1e498efa08ec22f2fd4e63c8ea808fee7d.png)

In case it doesn't work, I have slightly updated my original Regex, works fine.

---

<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: [January 27, 2023, 4:25pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/9 "2023-01-27T16:25:16Z")

</div>

> [@123qweasd](#):
>
> In case it doesn't work, I have slightly updated my original Regex, works fine.

You are right, my  
`Album NAMe (WITH CAPITAL AnD MixEd Letters) and UPPERCASE EXTENSION.MP3`  
becomes  
`Album NAMe (WITH CAPITAL AnD MixEd Letters) and UPPERCASE EXTENSION.mp3`  
using "Replace with regular expression":  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/9/90166f2eac3c5a8d8711ec7faa2b0985bf09a5f1.png)

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 4:33pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/10 "2023-01-27T16:33:40Z")

</div>

Great, glad it works for you as well.  
at least there is a working option.

@ohrenkino, let us know if the \_EXTENSION field works on your end.

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: [January 27, 2023, 4:38pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/11 "2023-01-27T16:38:04Z")

</div>

> [@123qweasd](#):
>
> \_EXTENSION field works on your end.

It does not.  
I checked the documentation and found

- `_FILENAME` denotes the file name of the file **including its extension**  
which apparently is the only way to treat the extension

---

<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: [January 27, 2023, 4:41pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/12 "2023-01-27T16:41:47Z")

</div>

That's strange, because in [the help](https://docs.mp3tag.de/format/#file-name-and-path-information) we can also find two placeholders,  
one without and one including the extension:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/9/9465e0ae8477c18bc58dab2b9afddd1f5a57643b.png)

And in the section above we see for [technical information](https://docs.mp3tag.de/format/#technical-information):

> Technical information fields begin with an underscore `%_` and are read-only.

---

<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 27, 2023, 4:48pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/13 "2023-01-27T16:48:56Z")

</div>

The special treatment of the \_FILENAME concerns only the action "Replace with regular expression".

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [January 27, 2023, 4:50pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/14 "2023-01-27T16:50:43Z")

</div>

Thanks for your prompt responses;  
Guess my post/regex was useful after all 😀  
Cheers,

---

<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: [January 27, 2023, 4:53pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/15 "2023-01-27T16:53:58Z")

</div>

Ahhh found it [here](https://docs.mp3tag.de/actions/replace-regexp/):  
Thanks for clarification about **Replace with Regular Expression**

 ![image](https://community.mp3tag.de/uploads/default/original/2X/e/ec5e01c049fa0f99599b47662ca0425f6c9ba9ea.png)

---

<div class="post-metadata">

### Author: ![wneclass2018](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/cdc98d/32.png) [@wneclass2018](https://community.mp3tag.de/u/wneclass2018)
#### Post date: [February 20, 2023, 10:21pm UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/16 "2023-02-20T22:21:08Z")

</div>

This action file, below, will solve your problems, and if you're looking to change the file extension of a file, in a WYSWYG manner, visit this community post: [FINALLY SOLVED: ACTIONS that mimics a WYSIWYG to Change File Extension or File Name and Extension (2022-2023)](https://community.mp3tag.de/t/finally-solved-actions-that-mimics-a-wysiwyg-to-change-file-extension-or-file-name-and-extension-2022-2023/60139)

There is no additional fields or placeholders required for this action. Just place it inside the actions folder, which is located here: %AppData%\Mp3tag\data\actions or C:\Users%username%\AppData\Roaming\Mp3tag\data\actions

[CONVERT File Extension (%\_extension%) to Lowercase by wneclass2018 (February 20th 2023).mta](https://community.mp3tag.de/uploads/short-url/6MrYXx5zKH3i4cH9cQMZSGahkBG.mta) (759 Bytes)

---

<div class="post-metadata">

### Author: ![123qweasd](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/1/a9adbd/32.png) [@123qweasd](https://community.mp3tag.de/u/123qweasd)
#### Post date: [February 21, 2023, 2:31am UTC](https://community.mp3tag.de/t/change-file-extension-to-lowercase-regular-expression/59816/17 "2023-02-21T02:31:51Z")

</div>

Thanks for the additional option =)  
would be nice to have this feature natively though.  
Cheers,
