62,046
社区成员
发帖
与我相关
我的任务
分享
string test = "{YCL_Loop}<li><a href=\"{YCL_List_FilePath}\">{YCL_List_Title}</a></li> {/YCL_Loop}{YCL_Loop}<li><a href=\"{YCL_List_FilePath}\">{YCL_List_Title}</a></li>{/YCL_Loop}";
Regex reg = new Regex(@"(?<={YCL_Loop})([\s\S]*?)(?={/YCL_Loop})");
MatchCollection mc = reg.Matches(test);
string b="";
foreach (Match m in mc)
{
b += "匹配结果:" + m.Value.PadRight(12, ' ') + "匹配开始位置:" + m.Index + "\n";
}