Using regular expressions in music templates

Hi,

I was under the impression that I could use regular expressions in music template filters, but I can’t get it to work. Is this broken or am I doing something wrong?

Here is the issue:

I have a custom attribute with the values:

Normal
Normal + Easy Listening
Easy Listening

I want to filter on ‘Normal’ in the music template, so I’ll get all items with the custom attribute set to ‘Normal’ or ‘Normal + Easy Listening’.

I tried the following filters:

Normal.*
^Normal.$
~Normal
~^Normal.
$
~ Normal
~ ^Normal.*$

I read somewhere that Perl syntax should be used, so I also tried

~m/Normal/
~ m/Normal/

… but all to no avail.

I hope someone could help me to resolve this issue.

Kind regards,
Marco

RegEx is working in mAirList, but the ^ charakter for every expression is needed.

I wrote up some examples here:

Another (easier) way to get the results: In the Music Block just use soft Attributes for an entry. Set up both values for your attribute and set both of them to 50 (Percent). Or change it accordingly to your needs.

mAirList will select the amount of items like you need for the rotation.

Hi Stefan,

Thanks again for your reply.
I forgot to metion that I also tried this:

~^Normal

and this is not working either. Perhaps something works differently in mAirList 7. It is also possible that regex is not working on text type attributes, your examples use numbers which might be treated differently.

I also tried your other solution (using soft attributes) and this seems to works quite well. I think I can do it this way, although it would be nice if the regular expressions would work too.

Kind regards,
Marco

1 Like