var regex = new Regex(model.Name + " ([0-9]+)$"); var target = allCategoriesTarget.FirstOrDefault(x => regex.IsMatch(x.Name));