Помогите понять, почему Regex.Match не захватывает группу:
var pattern = @"Te0/0/0.*(?<name>ST-KSK00-01)*";
var testStr = @"Te0/0/0upupST-KSK00-01";
var testMatch = Regex.Match(testStr, pattern);
Console.WriteLine("Result: "+ testMatch.Groups["name"].Value);
// Result: 'пустая строка'
pattern = @"ab.*(c(?<name>def)*g)ih";
testStr = @"abcdefgih";
testMatch = Regex.Match(testStr, pattern);
Console.WriteLine("Result: "+ testMatch.Groups["name"].Value);
// Result: def
Почему в первом случае группа <name> не захватывается, а во втором захватывается, хотя оба случая похожи