特定の URI が YouTube サイトのページであるかどうかを C# で確認する必要があります。
string theUri = "http://www.youtube.com/watch?v=B4N_CliHGUk&feature=player_embedded";
bool isYoutube = Regex.IsMatch(theUri.ToString(), @"/https?:\/\/(www\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com).*/i");
正規表現は複雑ではなく、問題なく動作するはずです。
https?:\/\/(?:www\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com).+
しかし、うまくいきません。bool は、isYouTube
このような単純な URI では false ですhttp://www.youtube.com/watch?v=KeC4NKDVl70&feature=player_embedded
どこが間違っていますか?ありがとうございました