пздц как из этой хуйни "/channel/UCNi9ncN8XrpIqOnXIhmDXKA" извлечь это UCNi9ncN8XrpIqOnXIhmDXKA ,составляю эту ебучую регулярку уже минут 10
/channel/UCNi9ncN8XrpIqOnXIhmDXKA - законченая строка? После UCNi9ncN8XrpIqOnXIhmDXKA данных больше нет?
using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"\/channel\/(?<code>\w+)"; string input = @"/channel/UCNi9ncN8XrpIqOnXIhmDXKA"; RegexOptions options = RegexOptions.Multiline; foreach (Match m in Regex.Matches(input, pattern, options)) { Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index); } } } Код using System; using System.Text.RegularExpressions; public class Example { public static void Main() { string pattern = @"\/channel\/(?<code>\w+)"; string input = @"/channel/UCNi9ncN8XrpIqOnXIhmDXKA"; RegexOptions options = RegexOptions.Multiline; foreach (Match m in Regex.Matches(input, pattern, options)) { Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index); } } }