一、Web请求示例
http://域名/wxauth.do?page=policy_product_list&pubid=gh_0r5943e2d1a9&opercode=00081001&productid=1&db=wxsmrs
如果需要获取具体的参数值,使用正则表达式函数如下:
function Get_Query_Param_Value(QueryStr,Param_Name : string) : string;
var
Reg : TRegEx;
Match : TMatch;
begin
Result := '';
Match := Reg.Match(QueryStr,'(?<=' + Param_Name + '=)[^&]*');
if Match.Success then
Result := Match.Value;
end;
二、函数说明
如果需要获取page参数,则:
QueryStr := 'http://域名/wxauth.do?page=policy_product_list&pubid=gh_0r5943e2d1a9&opercode=00081001&productid=1&db=wxsmrs'
sPage := Get_Query_Param_Value(QuesyStr, 'page' );
结果:sPage = 'policy_product_list'