это регулярное выражение работает
Код: Выделить всё
IEnumerable parameters = new Regex(@"{([^}]+)}").Matches(relativePath)
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
Код: Выделить всё
var regex = new Regex(@"{([^}]+)}");
var matches = regex.Matches(relativePath);
IEnumerable parameters = matches
.OfType()
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
Проблема в том, что я вынужден использовать этот вариант
Код: Выделить всё
var regex = new Regex(@"{([^}]+)}");
var matches = regex.Matches(relativePath);
IEnumerable parameters = matches
.OfType()
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
Код: Выделить всё
IEnumerable parameters = new Regex(@"{([^}]+)}").Matches(relativePath)
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
CS1061 'MatchCollection' не содержит определения для Не удалось найти «Где» и доступный метод расширения «Где», принимающий первый аргумент типа «MatchCollection» (вам не хватает директивы using или ссылки на сборку?)
Я был даже могу понять, что это работает
Код: Выделить всё
IEnumerable parameters = new Regex(@"{([^}]+)}").Matches(relativePath)
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
Код: Выделить всё
var regex = new Regex(@"{([^}]+)}");
var matches = regex.Matches(relativePath);
IEnumerable parameters = matches
.Where(m => m.Success)
.Select(m => m.Groups[1].Value);
Так как мне заставить регулярное выражение работать?
Подробнее здесь: https://stackoverflow.com/questions/790 ... p-9-0-does