Error:
sed: -e expression #1, char 49: unknown option to `s'
Example code producing this error:
sed "s/<[^<]*example.com[^>]*>\([^<]*\)</a>/\1/g"
Solution:
check for un-escaped forward slashes. Above, the slash in </a>
is unescaped. Everything coming after the third slash is considered to be options for s, like the final 'g' is intended to be.
Either escape the slashes:
sed "s/<[^<]*example.com[^>]*>\([^<]*\)<\/a>/\1/g"
Or use a different delimiter, e.g. '#':
sed "s#<[^<]*example.com[^>]*>#([^<]*\)#\1/g"