110,534
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string s = "abc{{123}}abc{{ccc{}ccc}}iii{{fff}}";
string[] result = Regex.Matches(s, @"\{\{(.+?)\}\}").Cast<Match>()
.Select(x => x.Groups[1].Value).ToArray();
foreach (var item in result)
Console.WriteLine(item);
}
}
}
123
ccc{}ccc
fff
Press any key to continue . . .