# if-Action mit Prüfung auf einen String like %(%text%)

**URL:** <https://community.mp3tag.de/t/if-action-mit-prufung-auf-einen-string-like-text/19635>\
**Category:** Allgemein\
**Created:** [December 28, 2017, 11:56pm UTC](https://community.mp3tag.de/t/if-action-mit-prufung-auf-einen-string-like-text/19635 "2017-12-28T23:56:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loyzious](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@loyzious](https://community.mp3tag.de/u/loyzious)\
**Post date:** [December 28, 2017, 11:56pm UTC](https://community.mp3tag.de/t/if-action-mit-prufung-auf-einen-string-like-text/19635/1 "2017-12-28T23:56:01Z")

</div>

Hi,

ich versuche eine Action zu schreiben welche prüfen soll:

1. gibt es im Comment Feld keinen String #INT  
UND
2. gibt es im Titel Feld einen String like '%(%Intro%)'  
wobei % für eine Wildcard für mehrere Zeichen steht und nicht auf nur das Wort "Intro" sonder auch "intro", "Extended","extended" geprüft werden soll

wenn beides zutrifft soll im Comment Feld #INT angehängt werden (am besten ohne vorher gehenden Leerzeichen wenn im Feld Comment noch nichts drinnen steht, sonst mit Leerzeichen)

Das ist mal der Stand anhand der Dinge die ich im Forum und in der Hilfe gefunden habe... leider funkt es noch nicht... hat jemand einen Tipp?

Format Value "COMMENT":

$if($AND($strstr(%comment%,'#INT')=0,$eql('#INT',$regexp('%title%','^(?:.+?)\s+({\<?(Intro?|intro?|Extended?|extended?)\s\*(?:.+?)\*[)}\>]\s$','#INT'))),%COMMENT% #INT,)

---

<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:** [December 29, 2017, 10:51am UTC](https://community.mp3tag.de/t/if-action-mit-prufung-auf-einen-string-like-text/19635/2 "2017-12-29T10:51:38Z")

</div>

> [@loyzious](#):
>
> ... soll im Comment Feld #INT angehängt werden (am besten ohne vorher gehenden Leerzeichen wenn im Feld Comment noch nichts drinnen steht, sonst mit Leerzeichen) ...

COMMENT \<== [%COMMENT%' ']'#INT'

... or ...

COMMENT \<== $if(%COMMENT%,%COMMENT%' ',)'#INT'

DD.20171229.1300.CET

Anregungen zum Ausprobieren:

COMMENT\_HAS\_#INT \<== $ifgreater($strstr($upper(%COMMENT%),'#INT'),0,1,0)

COMMENT\_HAS\_INTRO \<== $ifgreater($strstr($upper(%COMMENT%),'INTRO'),0,1,0)

COMMENT\_HAS\_EXTENDED \<== $ifgreater($strstr($upper(%COMMENT%),'EXTENDED'),0,1,0)

DD.20171229.1631.CET

---

<div class="post-metadata">

**Author:** ![loyzious](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/b2d939/32.png) [@loyzious](https://community.mp3tag.de/u/loyzious)\
**Post date:** [January 3, 2018, 4:30pm UTC](https://community.mp3tag.de/t/if-action-mit-prufung-auf-einen-string-like-text/19635/3 "2018-01-03T16:30:53Z")

</div>

Danke!

so funktioniert jetzt alles 🙂

Format Value "COMMENT":  
$if($AND($neql('#INT',$regexp(%COMMENT%,'^(?:.+?)?#INT(?:.+?)?$','#INT')),$eql('#INT',$regexp(%TITLE%,'^(?:.+?)\s+({\<?(Intro?|intro?|Extended?|extended?)\s\*(?:.+?)\*[)}\>]\s?$','#INT'))),$if(%COMMENT%,%COMMENT%' #INT','#INT'),%COMMENT%)
