Subject: Convert from literal string to ERE?

From: Peng Yu <[email-masked]>
Date: Sat, 17 Nov 2018 22:05:06 -0600

Hi,

I'd like to create an ERE expression for any literal string. I found
that "sed -e 's/\([][?+{|()\]\)/\\\1/g' " seem to work.

For example,
sed -e 's/\([][?+{|()\]\)/\\\1/g' <<< '\?+{|()[]'

Could anybody help confirm whether this will work for all the cases? Thanks.

-- 
Regards,
Peng