Regex reg = new Regex("",RegexOptions.IgnoreCase|RegexOptions.Multiline);
MatchCollection Allmatch = reg.Matches(a);
GroupCollection group;
string temp = "";
foreach(Match amatch in Allmatch)
{
group = amatch.Groups; temp = group[""].Value; ...}
主要是<#..#>也有尖括号,不能用<#(<INF>)#>
MatchCollection Allmatch = reg.Matches(a);
GroupCollection group;
string temp = "";
foreach(Match amatch in Allmatch)
{
group = amatch.Groups; temp = group[""].Value; ...}
主要是<#..#>也有尖括号,不能用<#(<INF>)#>
你用循环不可以取出来吗?
string str = "<#aaaaaa#><#bbbbb#><#ccccccccccc#>"; ArrayList arr = new ArrayList();
while(str.Trim().IndexOf("<#") != -1)
{
int start = str.IndexOf("<#")+2;
int end = str.IndexOf("#>");
arr.Add(str.Substring(start,end-start));
str = str.Substring(end+2);
} for(int i=0;i<arr.Count;i++)
{
Response.Write(arr[i].ToString());
}
不过我也想知道这种情况下正则表达式怎么写
<\#([^<>#]+)\#>
---------------
我不太明白你第三个#是什么意思?