# Extract and reformat date

**URL:** https://community.mp3tag.de/t/extract-and-reformat-date/7922
**Category:** Support
**Created:** [February 12, 2009, 7:52pm UTC](https://community.mp3tag.de/t/extract-and-reformat-date/7922 "2009-02-12T19:52:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kaokulk](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/k/f1d935/32.png) [@kaokulk](https://community.mp3tag.de/u/kaokulk)
#### Post date: [February 12, 2009, 7:52pm UTC](https://community.mp3tag.de/t/extract-and-reformat-date/7922/1 "2009-02-12T19:52:22Z")

</div>

This should be straightforward, I just don't understand the syntax of the scripting language yet...

In the field "Comments", I have text like this...

"Debuted on 12/25/1980 on the Top 100 charts."

I want to extract the date and reformat it in the Date field like: 1980/12/25.

So it's a question of finding the first, second, and third slashes, something like:

Date = "(2 positions left of first /), then a "/", (between the first and second /), then another "/", (then 4 positions to the right of the last /)"

So how do I write that line?

---

<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: [February 13, 2009, 8:23am UTC](https://community.mp3tag.de/t/extract-and-reformat-date/7922/2 "2009-02-13T08:23:36Z")

</div>

> [@kaokulk](#):
>
> ... In the field "Comments", I have text like this...  
> "Debuted on 12/25/1980 on the Top 100 charts."  
> I want to extract the date and reformat it in the Date field like: 1980/12/25. ...

Assuming the comment tagfield always contains a valid date string of format mm/dd/yyyy, then you may use the following actionsgroup to isolate and reformat the date string (tagfield DATE is saved as YEAR).

Begin Actionsgroup **TEST**

Action #1  
_Actiontype 5:_ **Format tag field**  
_Field:_ **DATE**  
_Formatstring:_ **%comment%**

Action #2  
_Actiontype 4:_ **Replace with regular expression**  
_Field:_ **DATE**  
_Regular expression:_ **^.+?(\d{2})/(\d{2})/(\d{4}).+?$**  
_Replace matches with:_ **$3/$1/$2**

[\_] case sensitive comparison

End Actionsgroup **TEST** (2 Actions)

DD.20090213.1022.CET

---

<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:21pm UTC](https://community.mp3tag.de/t/extract-and-reformat-date/7922/3 "2026-02-09T12:21:23Z")

</div>


