# Using regular expressions w/ "Text file to tag" conversion

**URL:** https://community.mp3tag.de/t/using-regular-expressions-w-text-file-to-tag-conversion/70001
**Category:** Support
**Created:** [October 15, 2025, 1:55am UTC](https://community.mp3tag.de/t/using-regular-expressions-w-text-file-to-tag-conversion/70001 "2025-10-15T01:55:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![JimS](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/838e76/32.png) [@JimS](https://community.mp3tag.de/u/JimS)
#### Post date: [October 15, 2025, 1:55am UTC](https://community.mp3tag.de/t/using-regular-expressions-w-text-file-to-tag-conversion/70001/1 "2025-10-15T01:55:14Z")

</div>

I want to extract the year (e.g. 1967) from a text file of song information (a single line per mp3). A solution I finally came up with was to import the line into the year tag location and then apply a **tag to tag** conversion using **$regexp(%year%,'^._(\d\d\d\d).\*_$',$1)**. But I could not find a way to do it directly. I was looking for something like, **$regexp(%line\_from\_file%,'^._(\d\d\d\d).\*_$',%year%)** but I could not find an appropriate tag or mapping to reference the text file line.

---

<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: [October 15, 2025, 6:07am UTC](https://community.mp3tag.de/t/using-regular-expressions-w-text-file-to-tag-conversion/70001/2 "2025-10-15T06:07:05Z")

</div>

> [@JimS](#):
>
> But I could not find a way to do it directly.

It is not possible to mix functions of a generating format string with the field assignment in a matching format string.  
The way to import the data "as is" first into a field and then treat it is the only way.

---

<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: [November 14, 2025, 6:07am UTC](https://community.mp3tag.de/t/using-regular-expressions-w-text-file-to-tag-conversion/70001/3 "2025-11-14T06:07:20Z")

</div>

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