Text to be processed :
""text""
"text"
""
output desired :
"text"
"text"
""
Tried with :
echo -e '""text""\n"text"\n""' | sed -e 's/"".*""/".*"/g'
But obviously no luck.
Cheers,
Text to be processed :
""text""
"text"
""
output desired :
"text"
"text"
""
Tried with :
echo -e '""text""\n"text"\n""' | sed -e 's/"".*""/".*"/g'
But obviously no luck.
Cheers,
You want to use a backreference (something that refers to a previously matched part) in your sed command :
Here are the modifications I did :
(...)
\1
-E
xtended regex so I wouldn't have to escape the grouping parenthesis