I'm trying to replace a string in a CSV terminated by ~ that it's like a password and I want to escape the delimiter to stop.
I use:
sed -i "s/\(z.*\~\)/\"\1\"/g"
And it's okey but the ~
is not escaped and the regex goes to the final of the line.
Is some way to "stop" the match any character that stops with ~
These are examples of that I have. The second part it's correct because I want to double quote the subexpresion:
zTG*?KM)ии*v=?~~~~~
zTG*?KMии$FhB?~S~~~~
I want to have (or stop)
"zTG*?KM)ии*v=?"~~~~~
"zTG*?KMии$FhB?"~S~~~~
but with de word command at the top I have:
"zTG*?KM)ии*v=?~~~~~"
"zTG*?KMии$FhB?~S~~~~"