c# 正则表达式,获得最外层括号中的字符串
如何使用正则表达式取出中最外层括号中的字符串
"
[
[
[4,意大利甲组联赛,0],
[
[962845,'卡利亚里','切辛线] ,
[0,1,0,1],
[0,0,1,32,45]
],
[0,
[
[9944097,1,40000.00],
[9,10850876,'1.81','0.45','1.50']
]
]
]
[
[4,西班牙甲组联赛,0],
[
[962845,'卡利亚里','切辛线] ,
[0,1,0,1],
[0,0,1,32,45]
],
[0,
[
[9944097,1,40000.00],
[9,10850876,'1.81','0.45','1.50']
]
]
]
]
"
这个数据字符串, 如何使用正则表达式获得去除最外层[]之后的数据
------解决方案--------------------
一已回答
C# code
string srw="你的字符串";
string pattern = @"(?is)(\[)?(.*)(\])";
string replacement = "$2";
Regex rgx = new Regex(pattern);
string mystring = rgx.Replace(srw, replacement);