[英]JMeter Regular Expression to extract number
I want to extract letters-number from response data and tried few regex but none are working. 我想从响应数据中提取字母数字,并尝试了一些正则表达式,但没有一个正在工作。
Eg the response data (json) will contain something like: 例如,响应数据(json)将包含以下内容:
"sessionId":"WC-123"
And I want to extract value of sessionId ie WC-123
and store it in variable so that it can be used in other tests. 我想提取sessionId的值,即
WC-123
并将其存储在变量中,以便它可以用于其他测试。
The format of sessionId will not change. sessionId的格式不会改变。 It's
WC-(Number)
. 这是
WC-(Number)
。
'"sessionId":"(WC-\d+)"'
这应该工作,虽然我不知道jmeter
Expected: Needs to Get the Session Id values 预期:需要获取会话ID值
Given formats: "sessionId":"WC-123"
给定格式:
"sessionId":"WC-123"
We need to create the following regex formats to extract the session Id values 我们需要创建以下正则表达式格式来提取会话ID值
Regular Expression formats 正则表达式格式
"sessionId":"(.+)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.