# Help with regular expressions

**URL:** <https://community.mp3tag.de/t/help-with-regular-expressions/56117>\
**Category:** Support\
**Created:** [January 29, 2022, 5:11pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117 "2022-01-29T17:11:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pedro\_Pistolas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pedro\_Pistolas](https://community.mp3tag.de/u/Pedro_Pistolas)\
**Post date:** [January 29, 2022, 5:11pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/1 "2022-01-29T17:11:54Z")

</div>

Hello there. I have several tags starting with the format dd\_mm\_yyyy and I want to replace "\_" with "" but only when it does appear between two numbers as above. Can you help me?

---

<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 29, 2022, 5:47pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/2 "2022-01-29T17:47:36Z")

</div>

Yes, but please show us some real examples. Some where you want to replace "\_" with "" and others which you want to be remain untouched.

---

<div class="post-metadata">

**Author:** ![Pedro\_Pistolas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pedro\_Pistolas](https://community.mp3tag.de/u/Pedro_Pistolas)\
**Post date:** [January 29, 2022, 8:40pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/3 "2022-01-29T20:40:58Z")

</div>

I have things like 06\_12\_2016 TEXT\_!\_.mp3 and I need 06/12/2016 TEXT _!_.mp3

---

<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 29, 2022, 8:46pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/4 "2022-01-29T20:46:10Z")

</div>

A slash `/` is not a valid character in filenames. You have to choose another character like - or you ommit it in a leading date DDMMYYYY.

Is this correct, you want to change  
`06_12_2016 TEXT_!_.mp3`  
into  
`06122016 TEXT!.mp3`  
You want to remove ALL occurences of underscores? Or do you want to remove the underscores only in the leading date as you wrote in your initial question.  
`06122016 TEXT_!_.mp3`

Please be as specific as possible.

---

<div class="post-metadata">

**Author:** ![Pedro\_Pistolas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pedro\_Pistolas](https://community.mp3tag.de/u/Pedro_Pistolas)\
**Post date:** [January 29, 2022, 9:09pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/5 "2022-01-29T21:09:46Z")

</div>

I know but it is for the tag of a song and I need to change the title, not the filename. I have been as specific as I can: I have 06\_12 in the title and I need 06/12 because the titles of 72 song is in this format. I can't batch replace every underscore because it appears in other positions

---

<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 29, 2022, 11:15pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/6 "2022-01-29T23:15:01Z")

</div>

In the time that we try to guess what you really want, you would have manually changed your 72 song titles with a 100% hit rate. If you don't want to do that, please show us your 72 song title with a screenshot from Mp3tag where this titles are visible. Maybe we can recognize a pattern there.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 30, 2022, 1:47am UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/7 "2022-01-30T01:47:39Z")

</div>

You won’t be able to use the “06/12” in the filename, as the “06” will become a folder based on windows structure prior to the forward slash. That is why the underscore or dash was suggested by @LyricsLover earlier in the thread. This is not something mp3tag can avoid for you.

---

<div class="post-metadata">

**Author:** ![Pedro\_Pistolas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pedro\_Pistolas](https://community.mp3tag.de/u/Pedro_Pistolas)\
**Post date:** [January 30, 2022, 7:45pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/8 "2022-01-30T19:45:50Z")

</div>

I wrote the pattern! Here another exemple: I want to change the first part but leave untouched the last "\_". As you can see in a TITLE dd/mm/yyyy is a viable thing

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

---

<div class="post-metadata">

**Author:** ![Pedro\_Pistolas](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/77aa72/32.png) [@Pedro\_Pistolas](https://community.mp3tag.de/u/Pedro_Pistolas)\
**Post date:** [January 30, 2022, 7:46pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/9 "2022-01-30T19:46:42Z")

</div>

Please interviene only if you know what are you talking about.

![image](https://community.mp3tag.de/uploads/default/original/2X/c/c9f6a9c1ebfa941ff2818a7c6b5a236f5b3ff4c0.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 30, 2022, 7:59pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/10 "2022-01-30T19:59:56Z")

</div>

You could try:  
`$regexp('02_03_2021 A chi dare il voto_','(\d+)_(\d+)_(.*)_','$1/$2/$3_')`

> [@Pedro\_Pistolas](#):
>
> Please interviene only if you know what are you talking about

On a personal note: participants in this forum contribute on a volountary basis. Their comments and contributions are usually to the best of their knowledge and well-meaning. This does include that there could be misunderstandings.  
Any contribution usually means that participants spent their time and effort without any guaranteed reward.  
If you do not like a comment then simply ignore it or if you have the impression that someone did not take everything into consideration but should have, then please try to give that feedback in away as constructive as possible.  
In this case I would have expected something like "I wanted to change the TITLE, not the filename".

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 30, 2022, 9:04pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/11 "2022-01-30T21:04:41Z")

</div>

> [@Pedro\_Pistolas](#):
>
> I have things like 06\_12\_2016 TEXT\_!\_.mp3 and I need 06/12/2016 TEXT _!_.mp3

This suggests you are looking for a FILENAME not a TITLE. Apologies if my comment was misguided, but this is what I was responding to regarding the slash.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 30, 2022, 9:12pm UTC](https://community.mp3tag.de/t/help-with-regular-expressions/56117/12 "2022-01-30T21:12:03Z")

</div>

Nice reply after one day on the forum. Perhaps provide better detail and scope moving forward to get the help you are asking for.

---

<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/help-with-regular-expressions/56117/13 "2026-02-09T12:29:39Z")

</div>


