您的位置:首页 > 其它

正则表达式匹配中括号中内容

2013-07-11 14:08 295 查看
常用,但好多人貌似没找到合适的,贴一个我正在用的,很简单:
System.Text.RegularExpressions.MatchCollection matchCollection = System.Text.RegularExpressions.Regex.Matches(“[abc adf asdfe]”, @"\[(.*?)]", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
foreach (System.Text.RegularExpressions.Match match in matchCollection)
{
var value = match.Value.Replace(match.Value, "");

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: