Two tips in Bourne-like shells:
You can't escape a single quote within a string quoted with single quotes¹. So you have to close the quote, add an escaped quote, then open the quotes again. That is: 'foo'\''bar', which breaks down as:
'foo' quoted foo
\' escaped '
'bar' quoted bar
yielding foo'bar.
(optional) You don't necessarily have to use / in sed. I find that using / and \ in the same sed expression makes it difficult to read.
For example, to remove the quotes from this file:
$ cat /tmp/f
aaa"bbb"'ccc'aaa
Given my two tips above, the command you can use to remove both double and single quotes is:
$ sed -e 's|["'\'']||g' /tmp/f
Based on my first tip, the shell reduces sed's second argument
(i.e., the string after the -e) to s|["']||g and passes that string to sed.
Based on my second tip, sed treats this the same as s/['"]//g.
It means
remove all characters matching either ' or " (i.e., replace them with nothing)
You probably need something more complex than this to do what you want, but it's a start.
¹ Except in zsh (primarily a Bourne/Korn-like shell even though it does also have a few features from csh/tcsh (like bash) and rc) when the rcquotes option is enabled after which you can escape single quotes as '' like in the rc shell or derivatives, as in echo 'There''s a single quote in that single-quoted string'.
"text"with'text'. Of course it won't do anything to"othertext". Show a few input lines, the corresponding undesired output, and explain what output you want instead.\"is the correct way of escaping quotation marks in sed command?". But your shell command uses a double-quoted string, and\"is correct there. Thesedprogram seess/"text"/'text'/igas the argument to-e.s/\"text\" /'text'/igWould it find only"text"with the space after it?sedis the right tool for the job, maybe you want an XML parser.