# Find a regular expression to split filename into fields

**URL:** <https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166>\
**Category:** Support\
**Created:** [December 21, 2023, 11:02am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166 "2023-12-21T11:02:56Z")\
**Posts on this page:** 9\
**Page:** 2

<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:** [December 22, 2023, 4:38pm UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/21 "2023-12-22T16:38:38Z")

</div>

> [@Paelman](#):
>
> Thank you for trying to help me, but it doesn't work!

As @ohrenkino told you: Use your real filename instead of the example string:  
 ![UseRealFilename](https://community.mp3tag.de/uploads/default/original/2X/0/01c81146da64d2b10afdf2c220c6e746e76fcec7.gif)  
If this format string does not work, your filename has some minor but essential differences.

> [@Paelman](#):
>
> Tom Jones & Paul Anka - Nights On Broadway  
> Tom Jones & Isaac Hayes - Don' Let Go

Both works fine in an Action "Guess values" with:  
Source: `$regexp(%_filename%,(.*) & (.*) - (.*),$1==$1==$3 (feat. $2))`  
Target format string: `%albumartist%==%artist%==%title%`

---

<div class="post-metadata">

**Author:** ![Paelman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/59ef9b/32.png) [@Paelman](https://community.mp3tag.de/u/Paelman)\
**Post date:** [December 22, 2023, 4:49pm UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/22 "2023-12-22T16:49:40Z")

</div>

It works fine now!  
Thanks again for the effort and fantastic help!!!  
Happy Holidays

---

<div class="post-metadata">

**Author:** ![Paelman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/59ef9b/32.png) [@Paelman](https://community.mp3tag.de/u/Paelman)\
**Post date:** [December 24, 2023, 11:36am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/23 "2023-12-24T11:36:05Z")

</div>

Can exceptions also be made for permanent duos?  
Such as: Sam & Dave, Peter & Gordon, Captain & Tenille etc...

---

<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:** [December 24, 2023, 11:49am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/24 "2023-12-24T11:49:26Z")

</div>

> [@Paelman](#):
>
> Can exceptions also be made for permanent duos?

Technically: Yes.  
Practically: No, because there is no complete list with all existing and possible Duo combinations that should be excluded.

You could filter for all songs first which are NOT "Sam & Dave", NOT "Peter & Gordon" and so on. But even then you can not be sure if a new Duo arise.

---

<div class="post-metadata">

**Author:** ![Paelman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/59ef9b/32.png) [@Paelman](https://community.mp3tag.de/u/Paelman)\
**Post date:** [December 24, 2023, 11:58am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/25 "2023-12-24T11:58:33Z")

</div>

OK, thanks for the explanation

---

<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:** [December 25, 2023, 8:00am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/26 "2023-12-25T08:00:41Z")

</div>

> [@Paelman](#):
>
> Such as: Sam & Dave, Peter & Gordon, Captain & Tenille etc...

Not to mention all the longer band names like Earth, Wind & Fire, Bell, Book & Candle, KC & the Sunshine Band, Emerson, Lake & Palmer.

This only shows that the & is no unique separator.

---

<div class="post-metadata">

**Author:** ![Paelman](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/59ef9b/32.png) [@Paelman](https://community.mp3tag.de/u/Paelman)\
**Post date:** [December 25, 2023, 9:00am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/27 "2023-12-25T09:00:09Z")

</div>

Thanks for the useful information.  
I have thousands of songs to process for my radio station's database.This works, but with hurdles and bumps, because I do not have the necessary knowledge for: Guess Values, regeexp... etc. to process many numbers at once.  
Question: May I, from time to time, ask you, as a specialist in this field, for your good advice?  
Or do you have ready-made rules that you can report to me anyway?  
Thank you in advance and Merry Christmas!

---

<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:** [December 25, 2023, 9:08am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/28 "2023-12-25T09:08:16Z")

</div>

> [@Paelman](#):
>
> Or do you have ready-made rules that you can report to me anyway?

The Forum is full of threads that deal with various problems to shift contents from one field to the next or to swap parts around.  
So I recommend the search function.  
And for all other problems (in relation to MP3tag): just ask. In a new thread.

---

<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:** [January 24, 2024, 9:09am UTC](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166/29 "2024-01-24T09:09:05Z")

</div>

Closed on January 24, 2024, 9:09am UTC

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

[Previous page](https://community.mp3tag.de/t/find-a-regular-expression-to-split-filename-into-fields/63166.md?page=1)
