INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Smartlist: how can I exclude some values?  (Read 590 times)

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Smartlist: how can I exclude some values?
« on: March 24, 2024, 11:51:24 am »

Hi all,

I want to make a smartlist which gives me the titles of songs which have a colour in its name. Something like name=blue, red, green etc.
However: I don't want to get titles with for instance blueS in it. Or redDISH. And probably there are dozens of other examples which I don't want to have in it.

How can I make my smartlist so it will only give me songs with these colours in it?

Thanks!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios

JJD

  • Recent member
  • *
  • Posts: 12
Re: Smartlist: how can I exclude some values?
« Reply #1 on: March 26, 2024, 11:38:46 am »

I think this example will get you close to what you are looking for. You'll have to tailor it to your needs.

The 1st Custom statement returns all songs with the words blue or red (case insensitive) in the name field. To make it case sensitive, change the 10 to 9. (See https://wiki.jriver.com/index.php/Test_and_Comparison_Functions#IsEqual for a description of the mode values.)

[=isequal([name], blue ; red,10)]=1

The 2nd Custom statement filters out the returned name formats that you don't want (eg, in this example REmastered; FRreddIE; credIT; COLored; DELIVered).

[=isequal([name], blues ; mastered; redd; cred; ored; ered,10)]=0

The attached screenshot shows the Smartlist with returned rows in the background.

Logged
Jack

zybex

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2616
Re: Smartlist: how can I exclude some values?
« Reply #2 on: March 26, 2024, 12:26:50 pm »

This regex matches only isolated words - add as many colors as needed separated by "|":

Code: [Select]
[=regex([name],/#\b(blue|green|red|yellow|purple|black|white|orange|pink)\b#/)]=1
Logged

MarkCoutinho

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 676
Re: Smartlist: how can I exclude some values?
« Reply #3 on: March 27, 2024, 09:03:29 am »

Brilliant, thanks!
Logged
Mark Coutinho
Dutch Top 40 collector of lyrics, sleeves and bios
Pages: [1]   Go Up