Convert result of matches from regex into list of string

后端 未结 6 888
余生分开走
余生分开走 2020-12-14 15:22

How can I convert the list of match result from regex into List? I have this function but it always generate an exception,

6条回答
  •  鱼传尺愫
    2020-12-14 15:34

    var regex = new Regex("{([A-Za-z])*}");
    var result= regex.Matches(text).Where(p => p.Success).Select(p => p.Value).ToList();
    

提交回复
热议问题