51Testing软件测试论坛

标题: 求教,web_reg_save_param_ex的正则表达式怎么使用非贪婪模式? [打印本页]

作者: door7474    时间: 2016-10-9 11:26
标题: 求教,web_reg_save_param_ex的正则表达式怎么使用非贪婪模式?
本帖最后由 door7474 于 2016-10-9 13:56 编辑

使用“.*”是可以匹配到内容的,不过是默认的贪婪模式。
现在需要使用非贪婪模式,于是改用“.*?”,不过就报错了。

web_reg_save_param_ex(
                 "ParamName=ttt",
                 "LB/RE=staff_code\", staff_code.*?expires",
                 "RB/RE=\r\n",
                 LAST);

报错信息:
Action.c(9): Error -26000: Failed to compile "staff_code", staff_code.*?expires" as Regular Expression, repetition-operator operand invalid.          [MsgId: MERR-26000]
Action.c(9): Registering web_reg_save_param_ex highest severity level was "ERROR"          [MsgId: MMSG-26389]
作者: 菜鸟@大虾    时间: 2016-10-9 13:40
正则表达式无效哦




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2