关于一个正则表达式的问题,请帮忙解决一下
字符串:abbabababababababaababababaaababababab
正则表达式:aab
即匹配结果:abbabababababababaababababaaababababab
^^^ ^^^
问题:如何选中 aab 中的 b?可否用正则表达式一次完成(非程序)
------解决方案--------------------呵呵,不行吧。
------解决方案--------------------楼主是要实现什么效果呢?
是取出字符串里的aab中的b?
------解决方案--------------------顶
------解决方案--------------------VB.NET 代码
Dim re As New Regex( "aa([b]) ", RegexOptions.None)
Dim mc As MatchCollection = re.Matches( "abbabababababababaababababaaababababab ")
For Each ma As Match in mc
Next
C#代码
Regex re = new Regex( "aa([b]) ", RegexOptions.None);
MatchCollection mc = re.Matches( "abbabababababababaababababaaababababab ");
foreach (Match ma in mc)
{
}