已关闭。此问题需要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");
2条答案
按热度按时间uz75evzq1#
使用regex
^(web_add_auto_header.*,)\n\s*
和替换$1
。它将替换以
web_add_auto_header
开头的字符串后的换行符。Here在regex101上演示。
nhaq1z212#
假设字符串开头的空格可以是制表符或多个空格,..你的正则表达式可能看起来像这样:
https://regex101.com/r/7J4sC7/1