# Apply an action if "X" parameter is true?

**URL:** <https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686>\
**Category:** Support\
**Created:** [July 20, 2020, 6:50pm UTC](https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686 "2020-07-20T18:50:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [July 20, 2020, 6:50pm UTC](https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686/1 "2020-07-20T18:50:20Z")

</div>

Hi, i wonder if there is any chance to create an action if "x" parameter is true. I know tha i can do that through filtering but i'am trying to find if there is a faster alternative.

For example:

_IF_ **%Artist% MATCHES "^\d\d. "**

_Replace with regular expression_

_Field_ **%Artist%**  
_regular expression_ **^.{4}**  
_replace matches with_ **""**

---

<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:** [July 20, 2020, 6:55pm UTC](https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686/2 "2020-07-20T18:55:40Z")

</div>

If a regular expression finds no match then it returns the original value.  
So if you use something like  
`$regexp(%artist%,(\d\d. )(.*),$2)`  
you should only get the treated result if it matches.

---

<div class="post-metadata">

**Author:** ![SpirosG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/spirosg/32/8589_2.png) [@SpirosG](https://community.mp3tag.de/u/SpirosG)\
**Post date:** [July 20, 2020, 6:58pm UTC](https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686/3 "2020-07-20T18:58:31Z")

</div>

> [@ohrenkino](#):
>
> $regexp(%artist%,(\d\d. )(.\*),$2)

You are absolutely correct!

Thank you @ohrenkino 👏 👏

---

<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:** [August 19, 2020, 6:58pm UTC](https://community.mp3tag.de/t/apply-an-action-if-x-parameter-is-true/49686/4 "2020-08-19T18:58:33Z")

</div>

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