示例#1
0
        public static string GetYouTubeStandardChannelId(this string str)
        {
            if (str == null)
            {
                return(null);
            }
            var match = YouTubeChannelIdRegex.Match(str);

            if (!match.Success || match.Groups["id"].Captures.Count != 1)
            {
                return(null);
            }
            return(match.Groups["id"].Captures[0].Value);
        }
示例#2
0
        // Extension methods

        public static bool IsValidYouTubeChannelUrl(this string str)
        {
            return(YouTubeChannelIdRegex.IsMatch(str));
        }