Convert result of matches from regex into list of string

With the Regex you have, you need to use Regex.Matches to get the final list of strings like you want:

MatchCollection matchList = Regex.Matches(Content, Pattern);
var list = matchList.Cast<Match>().Select(match => match.Value).ToList();

Leave a Comment