Hi,
I've strings such as:
Albumname (2015-01-15) [CAT#]
Albumname (2015-01-15)I was looking at the title function help for how to search digits but couldn't find anything. Or in the forum here.
I was looking an if statement to search that string 'YYYY-MM-DD' and if found do stuff.
I know in mp3tag you could do the following:
$if($eql($regexp(%album%,.+\d{4}-\d{2}-\d{2}.*,eqltrue),eqltrue),True,False)
Neglecting the fact that adding dates to your album titles is usually a bad idea*, you could do something like this:
$year($substr(%album%,$add($strrchr(%album%,'('),1),$sub($strrchr(%album%,')'),1)))
That's going to find the index of the last occurrence of ( in your album string and the last occurrence of ) which should hopefully contain the date, and then move those indexes to just encompass the date, then return that date as a substring to $year which should hopefully contain 2015. I didn't test it out so you might need to massage it slightly.
*You'd probably be better off using %date% and some other custom fields (%original release date% is what I use) to accomplish whatever it is you're trying to accomplish.
Thanks, I know but with this particular album, the date is necessary as it's a homemade compilation of all varying music from different years which I want to retain and just scrape the YYYY-MM-DD from the album.
Is there any easy way to match DDDD-DD-DD where D represents a digit as opposed to matching opening ( and closing ) as some albums may contain such chars?
Thanks, I know but with this particular album, the date is necessary as it's a homemade compilation of all varying music from different years which I want to retain and just scrape the YYYY-MM-DD from the album.
Is there any easy way to match DDDD-DD-DD where D represents a digit as opposed to matching opening ( and closing ) as some albums may contain such chars?
There's no regex functionality, no.
No problem, I thought I might have missed a way in the formatting help to do such a thing.
I've created a request a while ago for a regexp fn. Hopefully, it comes at some point. The only thing missing from foobar200 IMO.