# Rename file only if extension matches (.Mp3, .Flac, etc)

**URL:** https://community.mp3tag.de/t/rename-file-only-if-extension-matches-mp3-flac-etc/13499
**Category:** Support
**Created:** [May 31, 2012, 6:35am UTC](https://community.mp3tag.de/t/rename-file-only-if-extension-matches-mp3-flac-etc/13499 "2012-05-31T06:35:54Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [May 31, 2012, 8:52am UTC](https://community.mp3tag.de/t/rename-file-only-if-extension-matches-mp3-flac-etc/13499/4 "2012-05-31T08:52:43Z")

</div>

> [@LaurenBacall](#):
>
> Thanks so much, works a treat.  
> As for the Regular Expression, for anyone interested, this is what I'm using:  
> Action: Format value  
> Field: \_FILENAME  
> Format string: $regexp(%\_file\_create\_date%,(..)/(..)/(....),$3.$2.$1)

See also:  
[writing file creation date to tag with this format : YYYYMMDD (year, month, day)](https://community.mp3tag.de/t/11174/2)

If you set your system's date time display according to ISO 8601, then you do not need to convert the file's creation date tíme, that means %\_file\_create\_date% will return immediately '2012-05-31'.

DD.20120531.1252.CEST

---

_[View the full topic](https://community.mp3tag.de/t/rename-file-only-if-extension-matches-mp3-flac-etc/13499)._
