using System.Text.RegularExpressions;

public abstract class UriBasedSongValidatorBase : SongValidatorBase
{
    public abstract string UriValidatorRegex { get; }

    public UriBasedSongValidatorBase(ILogger logger, SpotifyApiClient spotifyApiClient) : base(logger, spotifyApiClient)
    { }

    public Match GetUriMatch(Uri songUri)
    {
        var regexp = new Regex(UriValidatorRegex, RegexOptions.IgnoreCase);
        return regexp.Match(songUri.ToString());
    }

    public override bool CanValidateUri(Uri songUri)
    {
        return GetUriMatch(songUri).Success;
    }
}