62,074
社区成员
发帖
与我相关
我的任务
分享
string regex = "\\w+(?=\\.\\w+\\?\\w+=\\w+(&\\w+=\\w+)*)";
string source = "Login.aspx?User=admin&pwd=123";
string reult = System.Text.RegularExpressions.Regex.Match(source, regex).Value;
Response.Write(reult);
\w+(?=\.aspx)
DECLARE @sql varchar(2000)
SET @sql='Login.aspx?User=admin&pwd=123'
DECLARE @mycount int
SET @mycount=charindex('.aspx',@sql)
SELECT substring(@sql,1,@mycount-1)
string str= System.Text.RegularExpressions.Regex.Match("Login.aspx?User=admin&pwd=123 ", @"([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?").Value;