正则表达式匹配中括号中内容
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, ""); }
相关文章推荐
- 利用正则表达式匹配输入内容 ----正则表达式
- 微博内容正则表达式匹配链接, 话题标签与@用户
- 微博内容正则表达式匹配链接, 话题标签与@用户
- Java正则表达式的多行匹配实战-将java文件中的单行和多行注释内容替换为空
- c# 正则表达式 匹配中括号&颜色过滤
- 微博内容正则表达式匹配链接, 话题标签与@用户
- 微博内容正则表达式匹配链接, 话题标签与@用户
- 使用Java正则表达式匹配、替换HTML内容
- php正则:匹配(),{},[]小括号,大括号,中括号里面的内容
- 通过正则表达式获取匹配内容
- js字符串方法match()匹配出所有正则表达式的内容
- qt中的正则表达式QRegExp使用大全以及匹配中括号[]方法
- 微博内容正则表达式匹配链接, 话题标签与@用户
- 匹配两个字符串之间的内容(正则表达式)
- C#匹配首尾中括号的正则表达式
- 正则表达式获取中括号里面的内容
- C++ 11 regex正则表达式匹配所有内容,包括空格回车换行>(.|\\r|\\n)*?
- 微博内容正则表达式匹配链接, 话题标签与@用户
- 正则表达式匹配两个特殊字符中间的内容
- JavaScript正则:用正则表达式匹配部分内容