正则表达式匹配中括号中内容
发布时间:2020-12-14 02:19:39 所属栏目:百科 来源:网络整理
导读:常用,但好多人貌似没找到合适的,贴一个我正在用的,很简单: System.Text.RegularExpressions.MatchCollection matchCollection = System.Text.RegularExpressions.Regex.Matches(“[abc adf asdfe]”,@"[(.*?)]",System.Text.RegularExpressions.RegexOpt
常用,但好多人貌似没找到合适的,贴一个我正在用的,很简单:
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,""); } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |