site) { ResourceSite::TWITTER => '/^https:\/\/twitter\.com\/\w+$/', ResourceSite::ANIDB => '/^https:\/\/anidb\.net\/creator\/(?:virtual\/)?\d+$/', ResourceSite::ANILIST => '/^https:\/\/anilist\.co\/studio\/\d+$/', ResourceSite::ANIME_PLANET => '/^https:\/\/www\.anime-planet\.com\/anime\/studios\/[a-zA-Z0-9-]+$/', ResourceSite::ANN => '/^https:\/\/www\.animenewsnetwork\.com\/encyclopedia\/company\.php\?id=\d+$/', ResourceSite::KITSU => '/$.^/', ResourceSite::MAL => '/^https:\/\/myanimelist\.net\/anime\/producer\/\d+$/', ResourceSite::SPOTIFY => '/$.^/', ResourceSite::YOUTUBE_MUSIC => '/$.^/', ResourceSite::YOUTUBE => '/$.^/', ResourceSite::APPLE_MUSIC => '/$.^/', ResourceSite::AMAZON_MUSIC => '/$.^/', default => null, }; if ($pattern !== null && Str::match($pattern, $value) !== $value) { $fail(__('validation.regex')); } } }