Trying to write a script that will set a tag %discversion% based on 2 existing tags, %media%, written by Picard, which may have the value "CD", and %discogs_format%, written by the discogs component in Foobar, which may contain one or both partial strings "Remaster" or "Reissue" (example string: 1 x CD, Album, Limited Edition, Numbered, Reissue, Remaster). If %media% contains the string "CD", I want the script to set %discversion% to "Remaster" if %discogs_format% contains that string, "Reissue" if it contains that string but not Remaster, or "1st" if it contains neither. After wracking my brain for most of the afternoon the final script I've tried is this:
That doesn't work. I thought maybe the underscore in %discogs_format% was problematic so I tried removing it and that didn't help. Maybe I'm using $rsearch wrong? Any help would be appreciated.