It is currently April 26th, 2024, 1:29 am

Substitute and regex trouble.

Get help with installing and using Rainmeter.
Dwarlorf
Posts: 16
Joined: March 23rd, 2020, 8:31 am

Substitute and regex trouble.

Post by Dwarlorf »

I found out about Rainmeter recently. I like it a lot. Great Job!

I'm making a simple skin for Foobar2000 to be used on a vertical 5"screen. I have a lot of songs in my library that features another artist. This is shown in Foobar behind the title of a song. I'm trying to filter out all those instances so that I only the titles are displayed in de the Skin. At a later stadium I want to display the features separately (For this I will open another topic)

These are all different options (all variants of feat, ft and featuring) I want to filter out :
Image

I have managed to filter out all instances in that picture but it also removes the word feature of the last song of Grant Green which is part of the title (Future Feature). I've tried so many things to prevent this but I can't find the solution (it is also the first time I'm using Regex). I hope someone has an answer.

This is the code I'm using :

Code: Select all

[MeasurePlayer]
Measure=NowPlaying
PlayerName=CAD
PlayerType=TITLE
RegExpSubstitute=1
Substitute=(?i).ft\..*$|\(ft.*$|.feat\..*$|.feat.*$|ft\..*$|\sft\s.":""
Last edited by Dwarlorf on March 26th, 2020, 8:29 am, edited 1 time in total.
MikeG621
Posts: 87
Joined: March 18th, 2013, 1:59 pm

Re: Substitute and regex trouble.

Post by MikeG621 »

"Feature" is getting caught by ".feat.*$", which you should be able to replace with ".featuring.*$". That would remove the ability to catch "(Feat Iggy Pop)", so add another one for ".feat\s.*$". You'll still catch "Feat." instances since you already have one for ".feat\..*$".
Dwarlorf
Posts: 16
Joined: March 23rd, 2020, 8:31 am

Re: Substitute and regex trouble.

Post by Dwarlorf »

That did it. Thanks'a'million! I figured there was an overlap somewhere but I just couldn't figure it out.