# I need your help to extract info from filename

**URL:** <https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205>\
**Category:** Support\
**Created:** [February 26, 2023, 11:57am UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205 "2023-02-26T11:57:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 11:57am UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/1 "2023-02-26T11:57:41Z")

</div>

Hello community!!! 🙂

I need some help from someone with **regex** skills!!! Ι have a bunch of videos with highlights from matches and I want to add some tags to them.

Let's say the initial filename is: **[2023-02-23] TeamA 0-0 TeamB [Highlights] CHANNEL.mp4**

**1.** I want to get the text " **2023-02-23**" between "**[**" and "**]**" characters and **revers** it. From " **2023-02-23**" to " **23-02-2023**". if this can be done.

**2.** I want to get the text " **TeamA 0-0 TeamB**" between "**] " and " [**" characters.

**3.** I want to get the text " **TeamA 0-0 TeamB**" between "**] " and " [**" characters and replace " **0-0**" to " **VS**".  
Result example: " **TeamA VS TeamB**".

**4.** I want to get the text " **CHANNEL**" after "\*\*] \*\*" character.

If anyone could help me i would greatly appreciate it!!!

**PS:** If there is any tool (online or not) which can make regex use more simple, please inform me!!! I mean something that I wont have to put all these symbols etc.

Thank you in advance!!!

---

<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:** [February 26, 2023, 12:08pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/2 "2023-02-26T12:08:44Z")

</div>

I am no friend of fiddling only with the filename.  
What does the tag data look like?  
WOuldn't it be much easier to use the tag fields to rename the files?  
And if the fields have not been filled, then that would be the first step.

E.g. it is much easier to modify

> [@Simos\_Sigma](#):
>
> 2023-02-23

if it can be found in a single field and you don't have to carry around all the other bits of the string.

---

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 12:19pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/3 "2023-02-26T12:19:03Z")

</div>

I am taking from filename because tags are empty and I just want to get parts from filename and add them to my tags accordingly!!! I just need the regex syntax... We are talking about hundreds of files.

---

<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:** [February 26, 2023, 12:24pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/4 "2023-02-26T12:24:46Z")

</div>

As I said: it is much easier to manipulate the contents of single fields than to treat a longish string.  
E.g. to get from

> [@Simos\_Sigma](#):
>
> **TeamA 0-0 TeamB**

to

> [@Simos\_Sigma](#):
>
> **TeamA VS TeamB**

could be achieved with a simple "Replace" and would not require a regular expression.

Under the condition that the regular expression has worked, how would you import the data form the filename? What would the mask look like?

---

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 12:39pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/5 "2023-02-26T12:39:57Z")

</div>

> As I said: it is much easier to manipulate the contents of single fields than to treat a longish string.  
> E.g. to get from **TeamA 0-0 TeamB** to **TeamA VS TeamB** could be achieved with a simple "Replace" and would not require a regular expression.

Okay, if I manage to get the text " **TeamA 0-0 TeamB**" from **filename** using **regex** and place it into **Title** tag (_for example_) then I can use **Replace** so to add the " **TeamA 0-0 TeamB**" as " **TeamA VS TeamB**" into **Artist** tag (_for example_). But as I can understand, I need regex for case **1** , **2** and **4**.

> Under the condition that the regular expression has worked, how would you import the data form the filename? What would the mask look like?

If I knew what the regex mask would look like I wouldn't ask for help!!! 😄

---

<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:** [February 26, 2023, 12:43pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/6 "2023-02-26T12:43:18Z")

</div>

> [@Simos\_Sigma](#):
>
> If I knew what the regex mask would look like I wouldn't ask for help

No, we are talking about Convert\>Filename-Tag.

> [@Simos\_Sigma](#):
>
> **[2023-02-23] TeamA 0-0 TeamB [Highlights] CHANNEL.mp4**

I would assume that this could be something like  
`[%releasetime%] %title% [%subtitle%] %mediatype%`  
A real filename would help.

---

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 1:10pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/7 "2023-02-26T13:10:33Z")

</div>

> [@ohrenkino](#):
>
> No, we are talking about Convert\>Filename-Tag.

Yes... Can't we add regex into "Convert\>Filename-Tag"?

> [@ohrenkino](#):
>
> **[2023-02-23] TeamA 0-0 TeamB [Highlights] CHANNEL.mp4**  
> I would assume that this could be something like  
> `[%releasetime%] %title% [%subtitle%] %mediatype%`  
> A real filename would help.

This "_**[2023-02-23] TeamA 0-0 TeamB [Highlights] CHANNEL.mp4**_" is an example of how a real filename could be!!!

I want to add (_reversed_) **2023-02-23** text from filename into `%releasetime%` tag.  
The text " **TeamA 0-0 TeamB**" from filename into `%title%` tag.  
The " **TeamA 0-0 TeamB**" from `%title%` tag into `%artist%` tag as " **TeamA VS TeamB**".  
And the text " **CHANNEL**" (_channel name_) from filename into `%copyright%` tag.

---

<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:** [February 26, 2023, 1:15pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/8 "2023-02-26T13:15:42Z")

</div>

> [@Simos\_Sigma](#):
>
> Can't we add regex into "Convert\>Filename-Tag"?

No.  
That would be "Guess value" - and much more complicated.

To modify the sequence in RELEASETIME try an action of the type "Replace with regular expression for RELEASETIME  
Search string: `(\d\d\d\d)-(\d\d)-(\d\d)`  
Replace string: `$3-$2-$1`

To replace "0-0" in TITLE with VS try an action of the type "Replace" for TITLE  
Search string: 0-0  
Replace with: VS

---

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 1:35pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/9 "2023-02-26T13:35:57Z")

</div>

I am really sorry if I am spending your time but to make your **Action** example work I first need to find a way to place **2023-02-23** into my `%releasetime%` tag etc. The same for your **Replace** example. They work, but if tags have something in them. As I said my tags are empty!!! Only thing I have is filename!!! So, how can I first add those parts from filename into my tags? Is there a way?

---

<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:** [February 26, 2023, 1:40pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/10 "2023-02-26T13:40:49Z")

</div>

> [@Simos\_Sigma](#):
>
> So, how can I first add those parts from filename into my tags? Is there a way?

Try Convert\>Filename-Tag  
You are requested to add the named tag fields like we discussed before:  
**[2023-02-23] TeamA 0-0 TeamB [Highlights] CHANNEL.mp4**  
Enter as mask:  
`[%releasetime%] %title% [%subtitle%] %copyright%`  
(you have not said what should be done with [Highlights])  
The preview in that function should show you the imminent result.  
The function fills the tag fields for all selected files that match this pattern.

---

<div class="post-metadata">

**Author:** ![Simos\_Sigma](https://community.mp3tag.de/user_avatar/community.mp3tag.de/simos_sigma/32/9966_2.png) [@Simos\_Sigma](https://community.mp3tag.de/u/Simos_Sigma)\
**Post date:** [February 26, 2023, 1:47pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/11 "2023-02-26T13:47:54Z")

</div>

Worked!!! 😄

I didn't want to do something with "**[Highlights]**" part so I used your example like this:  
`[%releasetime%] %title% [%dummy%] %copyright%`

Now I can use your **Action** examples to make the rest!!!

Thank you very much for your precious time!!! 🙂

---

<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:** [March 28, 2023, 1:48pm UTC](https://community.mp3tag.de/t/i-need-your-help-to-extract-info-from-filename/60205/12 "2023-03-28T13:48:32Z")

</div>

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