# funktionierende Aktion mit REGEXP

**URL:** https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265
**Category:** Allgemein
**Created:** [March 30, 2012, 9:59am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265 "2012-03-30T09:59:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [March 30, 2012, 9:59am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/1 "2012-03-30T09:59:21Z")

</div>

Ich habe eine funktionierende Aktion, die ARTISTSORT folgendermaßen ersetzt:  
(nach Komma drehen, nach & abschneiden)  
Jethro Tull & Friends -\> Jethro Tull  
Hooker, John Lee & sonstwer -\> John Lee Hooker  
Mann, Manfred & keiner -\> Manfred Mann

$regexp($regexp(%ARTIST%,'\s&\s.+$',),'^(.+?),\s(.+)$','$2 $1')

Nun habe ich einfach "&" durch "ft." ersetzt und gehofft, dass es für

Jethro Tull ft. Friends -\> Jethro Tull  
Hooker, John Lee ft. sonstwer -\> John Lee Hooker  
Mann, Manfred ft. keiner -\> Manfred Mann

genauso funtionieren würde. Dem ist nicht so. Wo ist der Fehler?  
$regexp($regexp(%ARTIST%,'\sft.\s.+$',),'^(.+?),\s(.+)$','$2 $1')

---

<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: [March 30, 2012, 10:16am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/2 "2012-03-30T10:16:59Z")

</div>

Vermutlich musst Du den Punkt nach ft "escapen". Probiers mal mit  
$regexp($regexp(%ARTIST%,'\sft.\s.+$',),'^(.+?),\s(.+)$','$2 $1')

Das ist nur eine ungetestete Vermutung, also bitte unbedingt TESTEN. 😉

---

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [March 30, 2012, 10:58am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/3 "2012-03-30T10:58:58Z")

</div>

> [@LyricsLover](#):
>
> unbedingt TESTEN. 😉

Danke für die schnelle Antwort. Der Test war leider negativ.  
Außerdem habe ich noch eine Klammer-Variante: Roger Glover (ft. Ronnie James Dio)

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [March 31, 2012, 5:58am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/4 "2012-03-31T05:58:51Z")

</div>

Die Aktion liefert diese Ergebnisse:

"Jethro Tull ft. Friends" -\>  
"Jethro Tull"

"Hooker, John Lee ft. sonstwer" -\>  
"John Lee Hooker"

"Mann, Manfred ft. keiner" -\>  
"Manfred Mann"

So soll es doch sein, oder?

---

<div class="post-metadata">

### Author: ![DJ\_Mucke](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dj_mucke/32/224_2.png) [@DJ\_Mucke](https://community.mp3tag.de/u/DJ_Mucke)
#### Post date: [March 31, 2012, 7:25am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/5 "2012-03-31T07:25:41Z")

</div>

> [@mbaa3](#):
>
> Wo ist der Fehler?  
> $regexp($regexp(%ARTIST%,'\sft.\s.+$',),'^(.+?),\s(.+)$','$2 $1')

Hallo, bei mir klappen beide Formatstrings, egal welche Konfiguration.  
 ![](https://community.mp3tag.de/uploads/default/original/2X/e/e7cfb7ea9b806fe8529ca5c1312e080debb613fc.JPG)

![](https://community.mp3tag.de/uploads/default/original/2X/e/e7cfb7ea9b806fe8529ca5c1312e080debb613fc.JPG)

---

<div class="post-metadata">

### Author: ![anon40879270](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/8797f3/32.png) [@anon40879270](https://community.mp3tag.de/u/anon40879270)
#### Post date: [March 31, 2012, 11:41am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/6 "2012-03-31T11:41:43Z")

</div>

Tut mir leid, dass ICH den Fehler gemacht habe. Die RegExp's sind in Ordnung! Versehentlich war noch der alte Tag-Feldname ARTISTSORT **ORDER** in der Aktion. Ich bin jetzt dabei, das Klammer-Problem zu lösen.

Entweder ich erweitere die RegExp so, dass  
Name, Vorname (ft. nixidixi) -\> Vorname Name  
Name, Vorname [ft. nixidixi] -\> Vorname Name  
wird.  
Oder (wahrscheinlich einfacher) ich entferne vorher per Aktion die Klammern.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [April 1, 2012, 6:57am UTC](https://community.mp3tag.de/t/funktionierende-aktion-mit-regexp/13265/7 "2012-04-01T06:57:39Z")

</div>

Auch die Klammer lassen sich leicht entfernen:  
$regexp($regexp(%ARTIST%,'\s(?[?ft.\s.+$',),'^(.+?),\s(.+)$','$2 $1')
