# How to replace part of a string with a value from another tag?

**URL:** https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833
**Category:** Support
**Created:** [May 27, 2024, 4:15pm UTC](https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833 "2024-05-27T16:15:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![whoit](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/f17d59/32.png) [@whoit](https://community.mp3tag.de/u/whoit)
#### Post date: [May 27, 2024, 4:15pm UTC](https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833/1 "2024-05-27T16:15:09Z")

</div>

I'd like to replace part of a string (first 4 chars) from RELEASETIME with the full value of YEAR

For example:  
ReleaseTime: 2007-08-27T22:00:00Z  
Year: 2024

Result: 2024-08-27T22:00:00Z

I've tried creating a "Replace with regular expression" where:  
field: RELEASETIME  
reg ex: `^.{0,4}`

but there I can't see a way to use the value from field YEAR as a replacement.

---

<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: [May 27, 2024, 4:21pm UTC](https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833/2 "2024-05-27T16:21:29Z")

</div>

You could try  
Convert Tag -\> Tag

Field:  
`RELEASETIME`  
Format string:  
`$regexp(%RELEASETIME%,\d{4},%YEAR%)`

This would replace the first 4 digits in RELEASETIME with the content of YEAR.

---

<div class="post-metadata">

### Author: ![whoit](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/w/f17d59/32.png) [@whoit](https://community.mp3tag.de/u/whoit)
#### Post date: [May 27, 2024, 5:06pm UTC](https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833/3 "2024-05-27T17:06:45Z")

</div>

Works perfectly - thanks!

---

<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: [June 26, 2024, 5:07pm UTC](https://community.mp3tag.de/t/how-to-replace-part-of-a-string-with-a-value-from-another-tag/64833/4 "2024-06-26T17:07:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
