# Regular Expression - remove dates - Simple?

**URL:** https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831
**Category:** Support
**Created:** [September 2, 2012, 6:00pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831 "2012-09-02T18:00:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Confuzed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ba9def/32.png) [@Confuzed](https://community.mp3tag.de/u/Confuzed)
#### Post date: [September 2, 2012, 6:00pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/1 "2012-09-02T18:00:21Z")

</div>

I have many files where someone has added the song's year, in brackets, to the end of the song title in the Title tag, such as:  
I Am The Walrus [1965]

I'd like to remove the [1965] (including the space leading it).

I created the following Replace Action -  
Field: TITLE  
Original: \s[\d\d\d\d]  
Replace with:

After I run the Action, the [1965] remains and I receive this message -  
Formatted tags in 0 of 250 files. 0 of 250 files renamed.

I've tried other variations with no success.

I suspected my Regular Expression was to fault. To experiment, I created some files with names identical to my Title tags. I entered this same Regular Expression into a file renaming program called RegexRenamer. It properly removed the year, brackets and leading space.

I must be doing something wrong or not doing something I should do.  
Your help will be greatly appreciated.

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [September 2, 2012, 6:10pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/2 "2012-09-02T18:10:27Z")

</div>

> [@Confuzed](#):
>
> I have many files where someone has added the song's year, in brackets, to the end of the song title in the Title tag, such as:  
> I Am The Walrus [1965]
> 
> I'd like to remove the [1965] (including the space leading it).

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 4:_ **Replace with regular expression** _Field \_\_\_\_\_\_\_\_\_\_\_\_\_\_:_ **TITLE** _Regular expression \_:_ **\s\*\[\d{4}\]\s\*$**_Replace matches with:_ [\_] Case sensitive comparison

End Action Group **\_Script Test#TEST** (1 Action)

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 2, 2012, 6:14pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/3 "2012-09-02T18:14:40Z")

</div>

Try this:

_Action type:_ **Replace with regular expression**  
_Field:_ **TITLE**  
_Regular expression:_ **^(.\*)\s+[\d{4}]$**  
_Replace matches with:_ **$1**  
[] _case-sensitive comparison_

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [September 2, 2012, 7:49pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/4 "2012-09-02T19:49:48Z")

</div>

It seems your expression is not the problem - using the right action type is.  
There is the **Replace** action and there's the **Replace with regular expression** action.  
Make sure you pick the last one.

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [September 2, 2012, 8:28pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/5 "2012-09-02T20:28:22Z")

</div>

True Dano but I'd like to add an anchor like $ to ensure a safer regular expression.

---

<div class="post-metadata">

### Author: ![Confuzed](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ba9def/32.png) [@Confuzed](https://community.mp3tag.de/u/Confuzed)
#### Post date: [September 4, 2012, 2:05am UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/6 "2012-09-04T02:05:20Z")

</div>

> [@stevehero](#):
>
> True Dano but I'd like to add an anchor like $ to ensure a safer regular expression.

Thanks all, for your kind help! I've now eliminated all of my annoying dates.

Your advice to use "Replace With Regular Expression" Action brings up another question.

When should one use the plain old "Replace" Action?

---

<div class="post-metadata">

### Author: ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)
#### Post date: [September 4, 2012, 2:16am UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/7 "2012-09-04T02:16:06Z")

</div>

> [@Confuzed](#):
>
> When should one use the plain old "Replace" Action?

Only when you want to replace a specific text string and not a regular expression.

Basically its the same as what the replace function does in microsoft word although it too has a replace with regular exp!

---

<div class="post-metadata">

### Author: ![JJ\_Johnson](https://community.mp3tag.de/user_avatar/community.mp3tag.de/jj_johnson/32/67_2.png) [@JJ\_Johnson](https://community.mp3tag.de/u/JJ_Johnson)
#### Post date: [September 4, 2012, 2:22am UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/8 "2012-09-04T02:22:23Z")

</div>

> [@Confuzed](#):
>
> When should one use the plain old "Replace" Action?

When you don't need a regular expression to match what you're replacing. That's to say, when the part being replaced is a known string that never has any kind of variation. If you wanted to remove ' [1965]', but didn't need to also remove ' [1966]' and ' [1967]', then you could have used a plain replace action.

---

<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:24pm UTC](https://community.mp3tag.de/t/regular-expression-remove-dates-simple/13831/9 "2026-02-09T12:24:02Z")

</div>


