[英]How to extract fixed number of characters from string in JMeter using regular expression extractor?
I have the following part of a JSON response: 我具有JSON响应的以下部分:
"created_at":"2017-05-08T14:01:25.903Z" “ created_at”:“” 2017-05-08T14:01:25.903Z“
How should I configure my "Regular Expression Extractor" in JMeter to extract the first 10 characters from this JSON response: 2017-05-08 . 我应如何在JMeter中配置“正则表达式提取器”以从此JSON响应中提取前10个字符: 2017-05-08 。
尝试以下模式:
"created_at":"([0-9]{4}-[0-9]{2}-[0-9]{2}).*?"
If you need first 10 characters only the relevant regular expression would be as simple as 如果您需要前10个字符,则只需使用相关的正则表达式即可
"created_at":"(.{1,10})
Demo: 演示:
References: 参考文献:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.