# Help with Actions, Regular Expression

**URL:** <https://community.mp3tag.de/t/help-with-actions-regular-expression/14407>\
**Category:** Support\
**Created:** [January 30, 2013, 4:34pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407 "2013-01-30T16:34:31Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 30, 2013, 4:34pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/1 "2013-01-30T16:34:31Z")

</div>

Hello all, I'm very new to the program, and wanted to see if someone can explain Regular Expressions a bit. I just don't know where to start, I'm not asking for a class, but just a little clarity.

This is what I'm trying to do.. I have a file that is named,

AZ - Problems (Radio).mp3

Now what I'd like to do with this file is Change (Radio) to (Clean) and then set the Genre as HipHop Clean. Pulling Clean from (Clean).

So say if the file was AZ - Problems (Dirty), I'd want to have the Genre set to HipHop Dirty and so on.

I think If I have an example, I could half way figure it out how to start doing some of this.

Any Takers,

Thanks

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [January 30, 2013, 4:49pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/2 "2013-01-30T16:49:25Z")

</div>

> [@mrclasik](#):
>
> Hello all, I'm very new to the program, and wanted to see if someone can explain Regular Expressions a bit. ...

Are you sure, that you want a pure 'regular expression solution'?  
Did you ever have tried the standard scripting functions, converter and actions to solve the task?

DD.20130130.1843.CET

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 30, 2013, 4:56pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/3 "2013-01-30T16:56:29Z")

</div>

> [@DetlevD](#):
>
> Are you sure, that you want a pure 'regular expression solution'?  
> Did you ever have tried the standard scripting functions, converter and actions to solve the task?
> 
> DD.20130130.1843.CET

At this point, I'm not sure on how to do it. I will look to see what I can find. If there is an easier way, I surely would prefer that... Thanks..

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [January 30, 2013, 5:06pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/4 "2013-01-30T17:06:14Z")

</div>

> [@mrclasik](#):
>
> At this point, I'm not sure on how to do it. I will look to see what I can find. If there is an easier way, I surely would prefer that... Thanks..

You may try to apply this group of actions ...

Begin Action Group **Test\_2013#20130130.mrclasik** 

Action #1  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%\_FILENAME%**  
_Guessing pattern:_ **%TMP\_PART1% - %TMP\_PART2% (%TMP\_PART3%)**

 

Action #2  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **\_FILENAME**  
_Formatstring:_ **%TMP\_PART1%' - '%TMP\_PART2%' (Clean)'**

 

Action #3  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%\_FILENAME%**  
_Guessing pattern:_ **%TMP\_PART1% - %TMP\_PART2% (%TMP\_PART3%)**

 

Action #4  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **GENRE**  
_Formatstring:_ **'HipHop '%TMP\_PART3%**

 

Action #5  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_PART1;TMP\_PART2;TMP\_PART3**

 

End Action Group **Test\_2013#20130130.mrclasik** (5 Actions)

 

DD.20130130.1900.CET

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [January 30, 2013, 5:16pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/5 "2013-01-30T17:16:42Z")

</div>

> [@mrclasik](#):
>
> At this point, I'm not sure on how to do it. I will look to see what I can find. If there is an easier way, I surely would prefer that... Thanks..

You may try to apply this group of actions ...

Begin Action Group **Test\_2013#20130130.mrclasik (2)** 

Action #1  
_Actiontype 2:_ **Replace**  
_Field \_\_\_\_\_\_:_ **\_FILENAME**  
_Original \_\_\_:_ **(Radio)**  
_Replace with:_ **(Clean)**

 [X] Only as whole word [X] Case sensitive comparison 

Action #2  
_Actiontype 7:_ **Import tag fields (guess values)**  
_Source format \_\_:_ **%\_FILENAME%**  
_Guessing pattern:_ **%TMP\_PART1% - %TMP\_PART2% (%TMP\_PART3%)**

 

Action #3  
_Actiontype 5:_ **Format value**  
_Field \_\_\_\_\_\_:_ **GENRE**  
_Formatstring:_ **'HipHop '%TMP\_PART3%**

 

Action #4  
_Actiontype 9:_ **Remove fields**  
_Fields to remove (semicolon separated):_ **TMP\_PART1;TMP\_PART2;TMP\_PART3**

 

End Action Group **Test\_2013#20130130.mrclasik (2)** (4 Actions)

 

DD.20130130.1911.CET

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 30, 2013, 6:25pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/6 "2013-01-30T18:25:11Z")

</div>

> [@DetlevD](#):
>
> You may try to apply this group of actions ...
> 
> Begin Action Group **Test\_2013#20130130.mrclasik (2)** 
> 
> Action #1  
> _Actiontype 2:_ **Replace**  
> _Field \_\_\_\_\_\_:_ **\_FILENAME**  
> _Original \_\_\_:_ **(Radio)**  
> _Replace with:_ **(Clean)**
> 
> [X] Only as whole word [X] Case sensitive comparison 
> 
> Action #2  
> _Actiontype 7:_ **Import tag fields (guess values)**  
> _Source format \_\_:_ **%\_FILENAME%**  
> _Guessing pattern:_ **%TMP\_PART1% - %TMP\_PART2% (%TMP\_PART3%)**
> 
>  
> 
> Action #3  
> _Actiontype 5:_ **Format value**  
> _Field \_\_\_\_\_\_:_ **GENRE**  
> _Formatstring:_ **'HipHop '%TMP\_PART3%**
> 
>  
> 
> Action #4  
> _Actiontype 9:_ **Remove fields**  
> _Fields to remove (semicolon separated):_ **TMP\_PART1;TMP\_PART2;TMP\_PART3**
> 
>  
> 
> End Action Group **Test\_2013#20130130.mrclasik (2)** (4 Actions)
> 
>  
> 
> DD.20130130.1911.CET

Thank you much, I will work with this to see if I can get it working and learn what it's doing.

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 30, 2013, 8:51pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/7 "2013-01-30T20:51:25Z")

</div>

Another Question. Is there a way to scan in the title for say (Clean), (Dirty), so on. I guess this is where the Regex would come in handy. Thanks in advance.

MrClasik

---

<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:** [January 30, 2013, 9:04pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/8 "2013-01-30T21:04:25Z")

</div>

> [@mrclasik](#):
>
> ... to scan in the title ...

What do you mean by that? Filter?  
%title% HAS Clean OR %title% HAS Dirty  
Or Replace?  
So the question in return is "scan and then do what?"

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 30, 2013, 9:25pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/9 "2013-01-30T21:25:23Z")

</div>

> [@ohrenkino](#):
>
> What do you mean by that? Filter?  
> %title% HAS Clean OR %title% HAS Dirty  
> Or Replace?  
> So the question in return is "scan and then do what?"

What I'm trying to do is Take what's in the title, and append it to the Genre. For instance, from my record pools, I get a file; 50 Cent - Major Distribution (Clean).mp3. The way i've been doing it, is a two - three part process. But I'd like to get it into an action, to take that (Clean) and append it to the Gere HipHop so the genre would be Hiphop Clean or HipHop Dirty, based on the title. As well, (Instrumental) and so forth. If I get an idea of how it's done, this would save a ton of time.

Thanks

---

<div class="post-metadata">

**Author:** ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)\
**Post date:** [January 31, 2013, 8:34am UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/10 "2013-01-31T08:34:21Z")

</div>

> [@mrclasik](#):
>
> What I'm trying to do is Take what's in the title, and append it to the Genre. For instance, from my record pools, I get a file; 50 Cent - Major Distribution (Clean).mp3. The way i've been doing it, is a two - three part process. But I'd like to get it into an action, to take that (Clean) and append it to the Gere HipHop so the genre would be Hiphop Clean or HipHop Dirty, based on the title. As well, (Instrumental) and so forth. If I get an idea of how it's done, this would save a ton of time. Thanks

Because you got already examples to solve the task, we are now at a point to clarify what tag-fields are really in usage ...

- real tag-field GENRE="HipHop" ... already set.
- real tag-field TITLE="" ... what content?
- pseudo tag-field \_FILENAME="50 Cent - Major Distribution (Clean)"

... does tag-field TITLE contain the same value as the filename or does TITLE not exist?  
... should tag-field TITLE be set with a new value? ... what value?  
... existing tag-field GENRE should be changed by adding the genre specifier, which has to be extracted from the round bracket clamb at the right edge from the filename (resp. from the tag-field TITLE ?), to set the value e. g. from GENRE="HipHop" to GENRE="HipHop Clean"?

Please report where do you get stuck.

If you want to see how a regular expression can help ...  
... this regular expression extracts the content from the round bracket clamb at the right edge of the filename ('genre specifier') out of the filename ...

**$regexp(%\_filename%,'^.+?\s\((.+?)\)$','$1')**

From:  
50 Cent - Major Distribution (Clean)  
To:  
Clean

Other example ...  
Converter: "Tag - Tag" ... or ... Action: "Format value"  
Field: GENRE  
Format string: **%GENRE%' '$mid(%TITLE%,$add($strrchr(%TITLE%,'('),1),$sub($sub($strrchr(%TITLE%,')'),$strrchr(%TITLE%,'(')),1))**

From:  
TITLE=50 Cent - Major Distribution (Clean)  
GENRE=HipHop  
To:  
TITLE=50 Cent - Major Distribution (Clean)  
GENRE=HipHop Clean

DD.20130131.1200.CET

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [January 31, 2013, 3:34pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/11 "2013-01-31T15:34:51Z")

</div>

> [@DetlevD](#):
>
> Because you got already examples to solve the task, we are now at a point to clarify what tag-fields are really in usage ...
> 
> - real tag-field GENRE="HipHop" ... already set.
> - real tag-field TITLE="" ... what content?
> - pseudo tag-field \_FILENAME="50 Cent - Major Distribution (Clean)"
> 
> ... does tag-field TITLE contain the same value as the filename or does TITLE not exist?  
> ... should tag-field TITLE be set with a new value? ... what value?  
> ... existing tag-field GENRE should be changed by adding the genre specifier, which has to be extracted from the round bracket clamb at the right edge from the filename (resp. from the tag-field TITLE ?), to set the value e. g. from GENRE="HipHop" to GENRE="HipHop Clean"?
> 
> Please report where do you get stuck.
> 
> If you want to see how a regular expression can help ...  
> ... this regular expression extracts the content from the round bracket clamb at the right edge of the filename ('genre specifier') out of the filename ...
> 
> **$regexp(%\_filename%,'^.+?\s\((.+?)\)$','$1')**
> 
> From:  
> 50 Cent - Major Distribution (Clean)  
> To:  
> Clean
> 
> Other example ...  
> Converter: "Tag - Tag" ... or ... Action: "Format value"  
> Field: GENRE  
> Format string: **%GENRE%' '$mid(%TITLE%,$add($strrchr(%TITLE%,'('),1),$sub($sub($strrchr(%TITLE%,')'),$strrchr(%TITLE%,'(')),1))**
> 
> From:  
> TITLE=50 Cent - Major Distribution (Clean)  
> GENRE=HipHop  
> To:  
> TITLE=50 Cent - Major Distribution (Clean)  
> GENRE=HipHop Clean
> 
> DD.20130131.1200.CET

I'm looking at the File name.. The Genre, Artist and Title Tags would already be set. Title tag matches filename after the Artist followed by the - . Thanks for all your help.. I will look at this and try to get it to work.. You've given something to work with.

Clasik

---

<div class="post-metadata">

**Author:** ![MrClasik](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@MrClasik](https://community.mp3tag.de/u/MrClasik)\
**Post date:** [February 5, 2013, 7:44pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/12 "2013-02-05T19:44:25Z")

</div>

Thank DetLevD, I'm starting to get a half way understanding. Long way to go, but very helpful..

---

<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:** [February 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/help-with-actions-regular-expression/14407/13 "2026-02-09T12:24:18Z")

</div>

Closed on February 9, 2026, 12:24pm UTC


