jmeter 为下面的格式编写正则表达式[已关闭]

n3ipq98p  于 2023-04-06  发布在  其他
关注(0)|答案(2)|浏览(104)

已关闭。此问题需要details or clarity。当前不接受答案。
**想要改进此问题?**添加详细信息并通过editing this post阐明问题。

3天前关闭。
Improve this question
你能帮忙把下面的正则表达式转换成预期的格式吗?
当前格式数据:

web_add_auto_header("Origin",  
      "http://eesere6090582.loot.welcome.com:8888");
web_add_auto_header("Wicket-Ajax",  
      "true");
web_add_auto_header("Wicket-Ajax-BaseURL",  
      "servers?1");
web_add_auto_header("Wicket-FocusedElementId",  
      "id40");
web_add_auto_header("X-Requested-With",  
      "XMLHttpRequest");

预期格式:

web_add_auto_header("Origin","http://eesere6090582.loot.welcome.com:8888");
web_add_auto_header("Wicket-Ajax","true");
web_add_auto_header("Wicket-Ajax-BaseURL","servers?1");
web_add_auto_header("Wicket-FocusedElementId","id40");
web_add_auto_header("X-Requested-With","XMLHttpRequest");
uz75evzq

uz75evzq1#

使用regex ^(web_add_auto_header.*,)\n\s*和替换$1
它将替换以web_add_auto_header开头的字符串后的换行符。
Here在regex101上演示。

nhaq1z21

nhaq1z212#

假设字符串开头的空格可以是制表符或多个空格,..你的正则表达式可能看起来像这样:

",\n\s+"   replace with   "\,"

https://regex101.com/r/7J4sC7/1

相关问题