# Please help with regexp

**URL:** <https://community.mp3tag.de/t/please-help-with-regexp/60136>\
**Category:** Support\
**Created:** [February 20, 2023, 4:50pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136 "2023-02-20T16:50:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jedrek](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jedrek](https://community.mp3tag.de/u/jedrek)\
**Post date:** [February 20, 2023, 4:50pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/1 "2023-02-20T16:50:31Z")

</div>

from a field that contains "artist - title (CD 2015) [something]" i would like to keep "(CD 2015)". I have tried tons of regexp suggestions but none work. Would anyone be so kind and help me? I know hove to setup actions etc but my regexp seems not to work.

---

<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:** [February 20, 2023, 4:52pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/2 "2023-02-20T16:52:35Z")

</div>

You want to remove everything excepting  
the opening bracket `(`  
`CD`  
Space  
4 digits  
the closing bracket `)`  
?

Or does the part inside the brackets varies?

---

<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 20, 2023, 4:56pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/3 "2023-02-20T16:56:31Z")

</div>

You could try an action of the type "Guess value"  
Source: %the field that contains the data%  
Target string: %dummy% (%the field that contains the data%) %dummy%

---

<div class="post-metadata">

**Author:** ![jedrek](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jedrek](https://community.mp3tag.de/u/jedrek)\
**Post date:** [February 20, 2023, 5:30pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/4 "2023-02-20T17:30:24Z")

</div>

whats whithin brackets may vary, ex. (VINYL 2020)

---

<div class="post-metadata">

**Author:** ![jedrek](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jedrek](https://community.mp3tag.de/u/jedrek)\
**Post date:** [February 20, 2023, 5:33pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/5 "2023-02-20T17:33:14Z")

</div>

intresting, do you mean like this?  
source: %\_parent\_directory%  
guessing patterns: %dummy% (%my\_target\_field%) %dummy%  
?

---

<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 20, 2023, 5:50pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/6 "2023-02-20T17:50:30Z")

</div>

What do you mean?  
The more to the point your question is, the higher the quality of the answer probably is.  
So you want to import data from the folder?

Such a case is described in the documentation:

> **[Import Tags from File and Folder Names – Mp3tag Documentation](https://docs.mp3tag.de/converters/import-tags-from-filenames/#import-parts-of-the-folder-structure-to-the-tag)**
>
> Documentation on Filename to Tag, a converter to import tags from file and folder names. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

**Author:** ![jedrek](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jedrek](https://community.mp3tag.de/u/jedrek)\
**Post date:** [February 20, 2023, 6:52pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/7 "2023-02-20T18:52:12Z")

</div>

I was trying to make the question as general as possible. If specific questions are preferred, my case is as follows, My music files are stored in folders named  
"artist - tilte (mediatype year) [catalog]"  
i'd like to extract the mediatype and year to - let's assume - the year field

---

<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 20, 2023, 6:54pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/8 "2023-02-20T18:54:45Z")

</div>

Try Convert\>Filename-Tag  
String: `%dummy% (%dummy% %year%) %dummy%\%dummy%`  
or  
String: `%dummy% (%mediatype% %year%) %dummy%\%dummy%`

---

<div class="post-metadata">

**Author:** ![jedrek](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@jedrek](https://community.mp3tag.de/u/jedrek)\
**Post date:** [February 20, 2023, 6:59pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/9 "2023-02-20T18:59:52Z")

</div>

Thank You! Thoose dummy fields are not that dumb at all 🙂

---

<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 22, 2023, 7:00pm UTC](https://community.mp3tag.de/t/please-help-with-regexp/60136/10 "2023-03-22T19:00:15Z")

</div>

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