我想使用 unix sed reqular表达式
替换不需要的字符串输入字符串
services:
mail_sent_subscriber:
class: Fidelise\SignUpBundle\EventListener\SentMailsListener
tags:
- { name: kernel.event_subscriber }
必需的字符串
echo ',"wanted1":"value1","unwanted";"unwanted";"wanted2":"value2",'
答案 0 :(得分:0)
尝试这个
脚本
echo ',"wanted1":"value1","unwanted";"unwanted";"wanted2":"value2",' | sed 's/,//g; s/"unwanted"//g; s/;//g; s/""/","/g'
输出
"wanted1":"value1","wanted2":"value2"