日期:2014-05-18  浏览次数:20429 次

字符截取!高手Look
exec   sp_GetCustomerInfo   @CityId,@CustomerName,@CustomerTel,@GroupId,@append,@pagesize,@pageindex,@docount字符截取
最终得到
@CityId
@CustomerName
@CustomerTel

这样
CityId
CustomerName
CustomerTel
的一个字符串数组   ???

select   *   from   Customer   where   HomePhone=@Phone   or   OtherPhone=@Phone   or   MobilePhone=@Phone又如这样的???

------解决方案--------------------
Regex re14 = new Regex(@ "@(? <par> [^,\s)]*)[,\s)] ");
MatchCollection mc1 = re14.Matches( "exec sp_GetCustomerInfo @CityId,@CustomerName,@CustomerTel,@GroupId,@append,@pagesize,@pageindex,@docount ");
for (int j = 0; j < mc1.Count; j++)
{
Response.Write( " </br> par: " + mc1[j].Groups[ "par "]);
}


另外需要在待匹配的字符串最后加一个空格 :)