# Replace if x and y is the same..

**URL:** <https://community.mp3tag.de/t/replace-if-x-and-y-is-the-same/15288>\
**Category:** Support\
**Created:** [December 13, 2013, 11:13pm UTC](https://community.mp3tag.de/t/replace-if-x-and-y-is-the-same/15288 "2013-12-13T23:13:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VeganAtheist](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/f14d63/32.png) [@VeganAtheist](https://community.mp3tag.de/u/VeganAtheist)\
**Post date:** [December 13, 2013, 11:13pm UTC](https://community.mp3tag.de/t/replace-if-x-and-y-is-the-same/15288/1 "2013-12-13T23:13:07Z")

</div>

i need something that  
$IfSameReplace(x,y,o)  
for example  
$IfSameReplace(%genre%,rock,1)  
$IfSameReplace(%genre%,metal,2)  
$IfSameReplace(%genre%,alternative,3)

if value of %genre% is the same with value "rock" then must displayed value "1",  
if not,then should not output it,but if %genre% is the same with "metal" then should display "2"  
how is possibly to realize it?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![VeganAtheist](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/v/f14d63/32.png) [@VeganAtheist](https://community.mp3tag.de/u/VeganAtheist)\
**Post date:** [December 13, 2013, 11:57pm UTC](https://community.mp3tag.de/t/replace-if-x-and-y-is-the-same/15288/2 "2013-12-13T23:57:37Z")

</div>

I found the solution in the documentation!thank you for programm! who same need it,look code..  
$if($eql(%genre%,alternative),1,)  
$if($eql(%genre%,rock),2,)  
$if($eql(%genre%,metal),3,)

---

<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 14, 2013, 8:59am UTC](https://community.mp3tag.de/t/replace-if-x-and-y-is-the-same/15288/3 "2013-12-14T08:59:24Z")

</div>

> [@VeganVenus](#):
>
> i need something that ...  
> if value of %genre% is the same with value "rock" then must displayed value "1",  
> if not,then should not output it,but if %genre% is the same with "metal" then should display "2" ...

**$if($eql($trim(%GENRE%),'alternative'),1,) $if($eql($trim(%GENRE%),'rock'),2,) $if($eql($trim(%GENRE%),'metal'),3,) ... or ... $if($stricmp($trim(%GENRE%),'alternative'),1,) $if($stricmp($trim(%GENRE%),'rock'),2,) $if($stricmp($trim(%GENRE%),'metal'),3,) ... or ... $regexp('/alternative/1/rock/2/metal/3/','^.\*/'$trim(%GENRE%)'/(\d+)/.\*$','$1',1)**

DD.20131214.1059.CET, DD.20150218.1738.CET

---

<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/replace-if-x-and-y-is-the-same/15288/4 "2026-02-09T12:24:48Z")

</div>

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


